Whether you can depends somewhat on how your site / templates are designed.
As far as EE is concerned, you don't really need to specify which channel or anything to retrieve an entry - the url_title
is enough on its own. So if you want to use the url structure domain.com/url_title
there is no reason why you could not do use a template design like this:
{exp:channel:entries url_title="{segment_1}" ... other parameters ... }
<h1>The title of this entry is {title}.</h1>
{/exp:channel:entries}
By itself the weakness with this approach is that it sort of pushes you to having one template to drive the whole site... which undermines some of the strength of EE as a CMS: having other segments in the URL is useful to help direct EE towards which template group to use, and to drive some features and responses arising from the user's activities on the site. But if having just one segment is important to you, you can maybe work around this by building in conditional logic to your master template... there are two things that might be worth considering:
- Once you have retrieved a channel entry using the
url_title
you can then access other information about the entry - such as what channel it is in, its ID, what categories have been assigned to it etc;
- The EE tempate layout system is quite flexible and allows you to build a template step-by-step based on information retrieved in earlier templates.
So you could have a 'parent' template that simply runs a channel entry call with the url_title, and then has a bunch of conditional logic to work out what template to load based on what information you retrieve from that call.
To do the redirect to the correct template without messing with the URL, you need one more trick. EE (at least up to EE5) does not allow for conditional terms in template layout tags, but does allow you to use layout variables - so use this switching approach you need to do a two-step thing:
- Set the parent template to transfer processing to a fixed template (do this by putting
{layout='some_template_group/some_template}
as the first line of your parent template.
- In your parent template use your conditional logic to identify the correct template to use (and any other important information derived from this knowledge) and use this to set the value for a layout variable (call it something like
processing_template
) - so something like
{layout:set name="processing_template"}template_group/template{/layout:set}
- Then put this entry as your first line of the 'processing_template`
{layout='{layout:processing_template}'}
Then EE when it processes one of your single term URLs will not only process the parent template, but also append the content of whatever other template you want based on the conditional logic processing...
Hope this helps.