1

I want to check if there are any channel field entries so something like

{exp:channel:entries channel="vacancies" author_id="{logged_in_member_id}"}

{if count==0}
there are no entries in this channel
{/if}

{/exp:channel:entries}

is there are count, rows or total_rows variables I can use?

2

Almost there, take a look at the available parameters and variables, here:
http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html

{exp:channel:entries channel="vacancies" author_id="CURRENT_USER" limit="1" dynamic="no"}
{if no_results}
there are no entries in this channel
{/if}
{/exp:channel:entries}

When using CURRENT_USER it only works if the visitor is logged in (see user guide)
so you probably also want to check {if logged_in} or {if logged_out}.
The {if_no_results} conditional is a dedicated conditional for this purpose.

  • author_id=CURRENT_USER the logged_in_member_id is parsed late,
    therefore this special parameter setting is available: current_user.
  • dynamic=no prevent the system from interpreting and acting on the url segments
  • limit=1 no need to for more entries

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.