We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Faulty URL

News and General

suntrop's avatar
suntrop
35 posts
5 years ago
suntrop's avatar suntrop

I don’t get it working. I want some pages, like about, contact, privacy etc. to be accessible at example.com/aboout, example.com/contact

I disabled strict URL, made the template group ‘home’ default and entered ‘{base_url}’ in the channel setting (‘URL location of this channel’). But when I open example.com/about I see an empty page, instead of the title and body copy.

When I output {template_group} and {template_name} it prints layouts and _default-layout

Why the ‘layout’ group and not my default ‘home’ group? And why the _default-layout?

(I started with the default installation with contents.)

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

I think it would help to skim the overview on how EE URLs work, just to get a feel for the default behavior.

Now if you’re working with the default install, you already have an ‘about’ url. And it’s going to pull up the index template in the about group. The way the default site is coded, any entry into the ‘About’ channel is going to end up in the ‘About’ sections left nav, and the links to all of them will look like about/url-title.

Where possible, I like to stick to that default behavior.

But, there are some other native tools that allow you to customize things.

First, there’s the pages module. It’s great for handling a few unique type urls where you want a structure like /about /contact /something-short - i.e. cases where you want one segment and don’t want it to have to be a template group name.

Second, there are template routes, which are a bit more complicated, but once you wrap your head around them, they’re very powerful. Check out this EEU article for an example of how you might use them to have both lists and single entries without adding the template name to the url.

There are some other third party options as well, Structure is popular. But try and shift your thinking away from ‘pages’ and think in terms of data that can be displayed however and wherever you want, not locked into a specific url.

       
suntrop's avatar
suntrop
35 posts
5 years ago
suntrop's avatar suntrop

Thanks Robin. I have read all those pages you linked, but thanks anyway. ExpressionEngine has a unique way of handling URL I’ve never seen before. I have used so many CMS and can’t remember having so much trouble “accessing” content. And honestly, I can’t see any benefit of ExpressionEngine’s way handling URL/structure. Even in that blog post it says “cause who needs that extra entry segment anyway” 😊

The problem I have with the Pages module is, it is more work for my clients and they have to remember to create an URL. Most of them even don’t know what an URL is. Even worse there is a URL and a Pages URI. That is bad UX.

Using template routes produces a PHP warning preg_match_all(): Compilation failed: unrecognized character after (? or (?- at offset 20 ee/legacy/libraries/Template_router.php, line 47

And … could you please correct my post title, I can’t. Damn autocorrect, sometimes Safari wants to put in German words into my english text 😊

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

It’s different, but honestly, if you just go with the default behavior it’s super easy. And aside from a handful that I’ll do as ‘pages’, I like the default. It requires no thinking from the content entry people and for most sites it’s going to yield a logical url structure.

Structure is the ‘go to’ for folks who really want a page structure approach to the logic. But if you can go native and default, that’s always my first choice.

And title is fixed 😉

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.