On the item_index.tpl of a module, once a profile owner has created an item in that module, I want the create button to disappear in that profile.
This is in order to limit them to the creation of one item, unless they delete it, in which case the button should reappear.
I am thinking an IF statement should work but I am doing something wrong. The button code is the same for all modules, in this case sales so:
{jrCore_item_index_buttons module="xxSales" profile_id=$_profile_id}
I am adding to it variations of code like:
{if isset($_item_id.item_id) && strlen($_item.item_id) > 0}
{else}
{jrCore_item_index_buttons module="xxSales" profile_id=$_profile_id}
{/if}
In some variations, I try using values creates by the form like sales_editor or sales_title. I've tried empty and is null instead of isset.
In every case that didn't "break the page", the buttons were hidden on two test accounts or not hidden on the two accounts. It treats them the same but one has an item created and one doesn't.
I'm expecting the IF statement to hide the buttons on the account with the item created but not the other. That never happens in any of my coding attempts.
What am I doing wrong?
--
Ken Rich
indiegospel.net
updated by @ken-rich: 07/29/16 04:28:38AM