I'm trying to use EE's Relationships field to select a page and get the full URI of that page.
Basically I want to be able to allow the client to select an entry from several different channels, and link directly to that entry. Maybe noteworthy - this site does not use structure or the pages module.
Here is the code I'm trying to use, where link_sbb
is my Relationships field name:
{exp:channel:entries channel="sidebar_banner" limit="1" dynamic="off"}
<a href="{link_sbb}{link_sbb:page_uri}{/link_sbb}">Learn More<span class="arrow"></span></a>
{/exp:channel:entries}
I can get url_title
to work but I don't want to use path=""
as the path's can be different, they can select pages from different channels/sections of the site etc. The permalink
and page_url
variables don't return a value either.
Is there an easy way to achieve this with EE's Relationships field?
EDIT:
Examples of possible URL's
- /products/category
- /products/category/subcategory
- /products/category/{url_title}
- /products/category/subcategory/{url_title}
- /applications/category
- /applications/category/{url_title}
- /resources/category
- /company/category
- /news/category
- /news/{url_title}
- /single-page
/segment_1/segment_2/segment_3/url_title
or/segment_1/segment_2/url_title
or/segment_1/category/url_title
- they will vary from url's with categories, # of segments, etc.