Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi! I need to can activate and deactivate secciones of my web site from admin panel. For example, I'm using this theme http://pi-themes.com/, that have many seccions and with some if statment to can activate or not each seccion?
For example, I've this code, but i dont know what put in "activate_from_admin"

Code: Select all
<cms:if activate_from_admin>
   <!-- - - - - - - - - - SECTION 1 - - - - - - - - - -->
   <div>
      <h2>This is my section 1</h2>
   </div>
   <!-- - - - - - - - - - END SECTION 1- - - - - - - - - -->
</cms:if>

<cms:if activate_from_admin>
   <!-- - - - - - - - - - SECTION 2 - - - - - - - - - -->
   <div>
      <h2>This is my section 2</h2>
   </div>
   <!-- - - - - - - - - - END SECTION 2- - - - - - - - - -->
</cms:if>
Hi,

One way would be to give each section a 'checkbox' editable region in the admin e.g. named 'chk_section_1' and 'chk_section_2'.
Code: Select all
<cms:editable 
  name="chk_section_1"
  label="Show section 1? "
  opt_values='Yes=1'
  type='checkbox'
/>

<cms:editable
  name="chk_section_2"
  label="Show section 2? "
  opt_values='Yes=1'
  type='checkbox'
/>

Depending on whether or not the relevant checkbox is ticked, we can show the sections on the frontend e.g.
Code: Select all
<cms:if chk_section_1>
   ... show SECTION 1 ..
</cms:if>

<cms:if chk_section_2>
   ... show SECTION 2 ..
</cms:if>

Hope this helps.
KK wrote: Hi,

One way would be to give each section a 'checkbox' editable region in the admin e.g. named 'chk_section_1' and 'chk_section_2'.
Code: Select all
<cms:editable 
  name="chk_section_1"
  label="Show section 1? "
  opt_values='Yes=1'
  type='checkbox'
/>

<cms:editable
  name="chk_section_2"
  label="Show section 2? "
  opt_values='Yes=1'
  type='checkbox'
/>

Depending on whether or not the relevant checkbox is ticked, we can show the sections on the frontend e.g.
Code: Select all
<cms:if chk_section_1>
   ... show SECTION 1 ..
</cms:if>

<cms:if chk_section_2>
   ... show SECTION 2 ..
</cms:if>

Hope this helps.


Thank!! exactly what I need.
3 posts Page 1 of 1
cron