0

We have an embed that shows latest posts on the home page.

{embed="/embeds/.sidebar_articles}

This works. But when I go to change anything in it, such as filtering the posts or even just making a text change nothing updates on the live website.

{if segment_1 == "section"}

    {if segment_3 == ""}

            {!-- ============================================

            DISPLAY A LIST OF MOST READ ARTICLES FROM THE
            CURRENT CATEGORY. FOR HOME PAGE- DISPLAY ACROSS
            ALL CATEGORIES.

            ============================================= --}

            <div class="art-preview">
            {exp:channel:entries
                channel="sections"
                limit="3"
                dynamic="off"
                {if segment_2}category="{segment_2_category_id}"{/if}
                orderby="view_count_one" }

                {if count == "1"}
                    {if segment_2 == ""}
                    <h3>Most read stories</h3>
                    {if:else}
                    <h3>Popular in <span data-source="{segment_2}">{segment_2_category_name}</span></h3>
                    {/if}
                {/if}
                <a href="/section/{segment_2}/{url_title}">
                    <div class="preview">
                    {if article_cover_image}
                        {exp:ce_img:pair src="{article_cover_image}" width="160" height="160" crop="yes"}
                        <img src="{made}" alt="">
                        {/exp:ce_img:pair}
                    {if:else}
                        <img src="http://placehold.it/160x160">
                    {/if}
                        <h4>{title}</h4>
                        <div class="meta">Last edited {edit_date format='%d/%m/%y'}</div>
                        {!-- <div class="lead"> {article_lead} </div> --} 
                    </div>
                </a>
            {/exp:channel:entries}                          
            </div> <!-- /art-preview -->


    {if:else}

            {!-- ============================================

            DISPLAY A LIST OF ENTRIES FROM THE SAME CATEGORY
            AS THE CURRENT ARTICLE.

            ============================================= --}

            <div class="art-preview">
            {exp:channel:entries
                channel="sections"
                limit="3"
                dynamic="off"
                {if segment_2}category="{segment_2_category_id}"{/if}
                url_title="not {segment_3}"}

                {if count == "1"}<h3>Related</h3>{/if}

                <a href="/section/{segment_2}/{url_title}">
                    <div class="preview">
                    {if article_cover_image}
                        {exp:ce_img:pair src="{article_cover_image}" width="160" height="160" crop="yes"}
                        <img src="{made}" alt="">
                        {/exp:ce_img:pair}
                    {if:else}
                        <img src="http://placehold.it/160x160">
                    {/if}
                        <h4>{title}</h4>
                        <div class="meta">Last edited {edit_date format='%d/%m/%y'}</div>
                        {!-- <div class="lead"> {article_lead} </div> --}
                    </div>
                </a>

            {/exp:channel:entries}                      
            </div> <!-- /art-preview -->

    {/if}

{if:else}


            <div class="art-preview">
            {exp:channel:entries
                channel="sections"
                limit="3"
                dynamic="off"
                {if segment_1 == ""}orderby="view_count_one"{/if}}

                {if count == "1"}
                    {if segment_1 == ""}
                    <h3>Most read stories</h3>
                    {if:else}
                    <h3>Latest News</h3>
                    {/if}
                {/if}
                <a href="/section/{categories}{category_url_title}{/categories}/{url_title}">
                    <div class="preview">
                    {if article_cover_image}
                        {exp:ce_img:pair src="{article_cover_image}" width="160" height="160" crop="yes"}
                        <img src="{made}" alt="">
                        {/exp:ce_img:pair}
                    {if:else}
                        <img src="http://placehold.it/160x160">
                    {/if}
                        <h4>{title}</h4>
                        <div class="meta">Last edited {edit_date format='%d/%m/%y'}</div>
                        {!-- <div class="lead"> {article_lead} </div> --}
                    </div>
                </a>
            {/exp:channel:entries}                          
            </div> <!-- /art-preview -->


{/if}

I've tried pasting this code direct into the template, it shows up but again doesn't show any changes made.

  • In what way do you change the code: FTP or do you change the code in the template file in the cms? Is cache enabled on .sidebar_articles? – Balloonatic Jul 21 '15 at 8:47
  • I'm doing it through the CMS. Not sure if cached is enabled as the developer has set it to DO NOT CHANGE – Evegate Jul 21 '15 at 9:07
  • To check the cache goto the template itself (.sidebar_articles), open up the Preferences Accordion at the bottom and let us know the state of the "Enable Caching" field. Also (appologies if you've tried this, you don't say) are you sure it's not browser cache? Go InPrivate/InCognito or Force refresh (Ctrl+F5) a few times just in case its your browser caching it!! – Blatant Jul 21 '15 at 10:08
  • Caching is not enabled. I've checked the site in another browser after the change but nothing changes. Have also force refreshed as you suggested – Evegate Jul 21 '15 at 11:09
  • You can try to check the option "save revision as File" and update. – Balloonatic Jul 21 '15 at 11:15
0

Your embed tag syntax looks wrong, missing closing quotes, also you don't need the first slash:

Wrong
{embed="/embeds/.sidebar_articles}

Correct
{embed="embeds/.sidebar_articles"}
| improve this answer | |
  • Thanks. Balloonatic had already spotted that. Corrected and didn't change anything. Just tried removed slash and it brings an error warning up saying it is needed – Evegate Jul 23 '15 at 8:05

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.