Thursday, 15 January 2015

php - Expression engine exclude entry of currently viewed page from "archive" section -



php - Expression engine exclude entry of currently viewed page from "archive" section -

i'm in need of showing news page subsequent archive section. exclude viewed entry archive section.

this look engine/php code far:

<article class="d1-d8 tp1-tp4 ml-all mp-all"> {exp:channel:entries channel="news" limit="1" status="open" sort="asc"} <h2><a href="#">{title}</a></h2> <p>{testo_notizia}</p>

then assign above entry_id in php variable

<?php $entry_id = '{entry_id}'; ?>

and go on look engine code

{/exp:channel:entries} <h2>archivio news</h2> <?php echo $entry_id; ?> //this shows correctly {exp:channel:entries channel="news" entry_id="not <?php echo $entry_id; ?>" status="open" sort="asc" dynamic="no"} //the filter not working/excluding previous entry_id listing <div class="titoli-notizie"> <h3><a href="{url_title_path='/news/view'}">{title}</a></h3> </div> {/exp:channel:entries} </article>

i solved using special url_title="not {segment_2}" instead of relying on php variables, much sweeter alternative in opinion.

php expressionengine

No comments:

Post a Comment