1

I'm new to EE, and I've been asked to update someone's site that has already been set up in EE - I'm floundering a bit here and don't know how to set up the page correctly (perhaps in over my head!). My terminology might not be up to snuff, so please bear with me. The code provided below was already in EE.

Goal: have a page (domain.com/store) that lists two types of CDs (artists own CDs, and OTHER CDs), where:

  1. the CD cover for OTHER CDs and title are links to more detailed info (domain.com/store/CDname), and
  2. full info is shown for OWN CDs (doesn't need to linked to its own page)

I can't, for the life of me, figure out what I need to do! Perhaps this is too much for just one answer, and perhaps I don't know enough to structure the question correctly...

The page template is:

{embed="inc/.head"}

{embed="inc/.nav"}

{embed="inc/.store"}

{embed="inc/.sidebar"}

{embed="inc/.footer"}

and the {embed="inc/.store"} is set up like this:

<div id="main"> <!-- #main, #wrap, and #content are closed in the .sidebar -->
    <div class="wrap">
        <div id="content">

    <div class="block">
        <h4 id="myrecordings">MY RECORDINGS</h4>
        <div class="block-content">
                <ul class="news" id="myCds"> <!-- FULL INFO FOR THESE -->

{exp:channel:entries channel="store" orderby="date" sort="asc" category="9"}
                        <li>
                            <div class="pic">
                                {if bc}<a href="{bc}" target="_blank">{if:elseif amazon}<a href="{amazon}" target="_blank">{/if}<img src="{cover}" alt="{title}" width="150" height="150" /></a>
                            </div>
                            <div class="details">
                                <h5><a href="{comment_url_title_auto_path}">{title}</a></h5>
                                <p style="font-weight:bold;">{subtitle}</p>
                                <p>{personnel}</p>
                                <p>{store_description}</p>
                                  <p style="font-size:18px;">{if bc}<a href="{bc}" target="_blank">Buy On Bandcamp</a> | {/if}{if amazon}<a href="{amazon}" target="_blank">Buy On Amazon</a> | {/if} {if itunes_link}<a href="{itunes_link}" target="_blank">Buy On iTunes</a>{/if}</p>
                                <p>{track_list}</p>
                            </div>
                        </li>
{/exp:channel:entries}
    </ul>
<div class="clear"></div>
                </div> <!-- /block-content -->
    </div> <!-- /block -->

<div class="block">
    <h4 id="other">OTHER RECORDINGS</h4>
        <div class="block-content">
            <ul class="news cdGrid"> <!-- PARTIAL INFO FOR THESE -->

{exp:channel:entries channel="store" orderby="date" sort="asc" category="14"}
            <li>
                    <div class="pic">
                        <a href="{comment_url_title_auto_path}"><img src="{cover}" alt="{title}" width="150" height="150" /></a>
                    </div>
                    <div class="details">
                        <h5>{title}</h5>
                            <p style="font-weight:bold;">{subtitle}</p>
                    {!-- <p>{personnel}</p>
                    <p>{store_description}</p>
                    <p style="font-size:18px;">{if bc}<a href="{bc}" target="_blank">Buy On Bandcamp</a> | {/if}{if amazon}<a href="{amazon}" target="_blank">Buy On Amazon</a>{/if}{if itunes_link} | <a href="{itunes_link}" target="_blank">Buy On iTunes</a>{/if}</p>
                    <p>{track_list}</p> --}
                    </div>
                </li>
{/exp:channel:entries}
                </ul>
                        <div class="clear"></div>
                    </div>
                </div>
  • The only thing you are missing really is what actually isn't working? Did this code that your showing here already exist and work? If so, what to you need to add/fix? If not, have you created this code based on some already working code? If you could update your question with a bit more info along these lines I'm sure someone here can get you sorted out. Cheers Steve. – Steve Holland Aug 30 '13 at 9:14
  • yes, good point @SteveHolland! The code existed and works - to a degree. Here's a test page: ernestocervini.com/test notice that any of the OTHER CDs - when you go their page - have the same layout as the test page, but with only the one CD listed. The single CD page seems to have the same layout as the test page - which makes me think there is a template(?) issue. It's like (for any Wordpress users) that the content area of a page template is being used for a post template. hope this helps to clear anything up! – alexwc_ Aug 30 '13 at 13:21
0

For the /store/ page, continue as you are doing and have your two channel entry loops. The first loop currently hits category=9 for My Recordings. Continue this and output only the information you desire. Do the second loop on category=14 for Other Recordings and output only the information you desire.

Both of these areas would then link to individual item pages. You could have your template look to see if {segment_3} exists. This would be the title_url for each individual CD. If {segment_3) exists, look at that specific item in a Channel Entry loop and depending on the category, output as appropriate.

Your URL structure could look like: \store\ - all items \store\cd_name - output either as My Recording and show Other Recordings at bottom, or output as Other Recording and display as needed.

This can all be done in one template.

| improve this answer | |
  • Ack.. I feel this is getting closer, if it isn't too much trouble, what is this {segment_X} business? I've been seeing it online over the past hour, but don't quite understand it, or how to implement it! – alexwc_ Aug 30 '13 at 20:43
  • oh my... you've helped me solve this bloody problem that I've ruining my sanity over. I just researched segment_* stuff... a lifesaver. thanks @Scott – alexwc_ Aug 30 '13 at 21:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.