1

ExpressionEngine 2.7.2

We have an EE/MSM install that's managing 2 different websites (desktop and mobile). I'm building a tool that allows the administrators to generate custom URLs and I need to output the Pages module URLs for both websites. Here's my code:

<select name="page" id="page">
    <option value="">Select Page...</option>
    <optgroup label="Desktop Site">
        {exp:channel:entries channel='content_page|coupons_page|garage_door_repair_page' show_pages='only' sort='asc' orderby='title' dynamic='no' site='default_site'}
            <option value="{page_url}">{title}</option>
        {/exp:channel:entries}                          
    </optgroup>
    <optgroup label="Mobile Site">
        {exp:channel:entries channel='content_page' show_pages='only' sort='asc' orderby='title' dynamic='no' site='mobile_site'}
            <option value="{page_url}">{title}</option>
        {/exp:channel:entries}  
    </optgroup>
</select>

The default site code (first channel:entries tag) outputs as I'd expect. On the mobile site entries (second channel:entries tag), though, no entries are output at all. If I remove the show_pages attribute the entries will output but the {page_url} outputs blank. I've checked every entry on the mobile site (there's only 3) and all of them have page URLs that are working normally. The template this code resides in lives on the desktop site.

Is this a bug or am I doing something wrong?

  • 1
    Without seeing the full setup and content it will be hard to say. But i suggest testing various things first to see what data you have where. First off, run the second entries tag in your second site. does it work? Split the above code into separate templates - does it work. use a basic entries tag, clean and simple and if that is not outputting the pages_url then i would suggest triple checking your fields. It could be a bug, i do not know. but i have done this before without issue - so i would suggest it is a niggle somewhere. – Nevsie - Modeten Dec 19 '13 at 10:50
  • Thanks, Nevsie! If I place the second entries tag inside a template on the second website it executes perfectly. If I try to embed that template from the first site it no longer works just like when I place the code itself inside a template on the first website. – ShawnCBerg Dec 19 '13 at 21:10
  • okay. so the second tag executes on its own site. but when put in a template on another site it no longer works. correct? if so. i would suggest (assuming it is not a bug) to check the channel name, and site name. i would also remove all other parameters to see if they are confusing things i.e. remove everything like show pages only. etc. Strip it back to literally the entries tag and titles - nothing clever and build it up from there. if using an embed do not forget the site name in this: ellislab.com/expressionengine/user-guide/cp/sites/… – Nevsie - Modeten Dec 29 '13 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.