Hi
We have been reading about parse order and alike but are still head scratching why the below doesn’t work - unless the //{includeitem} is there. Clearly we don’t want to output our variable just to be able to use it.
We tried the below in a snippet also without success. I guess we have some fundamental things wrong with the approach(es) of the code below. All suggestions welcome.
Thanks
Pod
<?php
$groupid = $this->EE->session->userdata['group_id'];
?>
{exp:query sql="SELECT group_title FROM exp_member_groups WHERE group_id = '<?php echo $groupid;?>' "}
<div id="pageMenu">
{exp:channel:categories channel="page_heading"}
<a href="#">{category_name}</a>
{exp:channel:entries channel="page_heading" disable="member_data|trackbacks" category="{category_id}" uncategorized_entries="no"}
{preload_replace:includeitem="{exp:StringSearch needle='{group_title}' haystack='{access}' length='7'}"}
//{includeitem}
{if '{includeitem}' == '1'}
<a href="#">{title}</a>
{/if}
{/exp:channel:entries}
{/exp:channel:categories}
</div>
{/exp:query}