Hey all,
Firstly, just started using this (I've been a WordPress and Expression Engine hardcore user for the last 5 years) and I am so impressed by the balance of simplicity and agility. Bravo devs. Bravo.
Now, coming from my background and "methods" I wonder am I asking too much / pushing to hard with what I am trying to achieve in the, as I count, 8th hour of using this CMS.
Ok, so I love the idea of "Globals dot php" great way of setting up what I would refer to as "snippets" in EE, so handy for copyright notices, footer text etc.
So basically I am using a single globals file to host webmaster tools ID, analytics id etc along with some address jazz.
Now, setup and output is so easy, love it, however, what if I want to conditional check for values on global "get_custom_field"
Basically I have this as a simple starter global:
How can / do (is it even possible) prefix outputs in my footer if the field exists, for example:
These little "ifs" would be very handy for prefixing text / icons (i.e. bootsrap glyphs or font awesome <i class=""> stuff).
Maybe someone can shed some light - if so thanks so much.
Firstly, just started using this (I've been a WordPress and Expression Engine hardcore user for the last 5 years) and I am so impressed by the balance of simplicity and agility. Bravo devs. Bravo.
Now, coming from my background and "methods" I wonder am I asking too much / pushing to hard with what I am trying to achieve in the, as I count, 8th hour of using this CMS.
Ok, so I love the idea of "Globals dot php" great way of setting up what I would refer to as "snippets" in EE, so handy for copyright notices, footer text etc.
So basically I am using a single globals file to host webmaster tools ID, analytics id etc along with some address jazz.
Now, setup and output is so easy, love it, however, what if I want to conditional check for values on global "get_custom_field"
Basically I have this as a simple starter global:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template name='globals' title='Globals' executable='0'>
<cms:editable name='call_to_action_bar' title='Call to Action Bar' type='richtext' />
<cms:editable name='company_address' title='Company Address' type='text' />
<cms:editable name='company_tel' title='Company Telephone' type='text' />
<cms:editable name='company_fax' title='Company Fax' type='text' />
<cms:editable name='company_email' title='Company Email' type='text' />
<cms:editable name='company_web' title='Company Web' type='text' />
</cms:template>
<?php COUCH::invoke(); ?>
How can / do (is it even possible) prefix outputs in my footer if the field exists, for example:
- Code: Select all
<footer>
<cms:if get_custom_field 'company_tel' !="">
Tel: <cms:get_custom_field 'company_tel' masterpage='globals.php' /><br />
</cms:if>
</footer>
These little "ifs" would be very handy for prefixing text / icons (i.e. bootsrap glyphs or font awesome <i class=""> stuff).
Maybe someone can shed some light - if so thanks so much.