Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: Article Manager 2:
Overriding a default META tag with "templateIF"...

 

 


bruno
User

Feb 11, 2007, 2:52 PM

Post #1 of 7 (352 views)
Shortcut
Overriding a default META tag with "templateIF"... Can't Post

Please help! I can't get this to work and I know it's something simple...

I'm trying to create a feature that will allow an editor to override the default meta tags for any given article.

For example, if the editor wants to use custom keywords or description for an article, they can check the "Override Meta Tags" box, and enter the custom meta tags.

If they editor does not check the override box, then the default Meta tags will be published.

I'm trying to use a "templateIF" to accomplish this. I created a new field as an "Override" check box. The field is setup as a "string" with a checked value of "yes" and an unchecked value of "no".

Here's the code I'm using in my template.



Code
 
<!-- templateIf : $article.overrideMETA$ == "yes" -->
<META name="keywords" content="$article.metaKeywords$">
<META name="keywords" content="$article.metaDescription$">
<!-- /templateIf -->

<!-- templateIf : $article.overrideMETA$ == "no" -->
<META name="keywords" content="default keyword set">
<META name="description" content="default description">
<!-- /templateIf -->



Does this look right? It's not working...


(This post was edited by bruno on Feb 11, 2007, 3:04 PM)


diness
User

Feb 11, 2007, 3:07 PM

Post #2 of 7 (346 views)
Shortcut
Re: [bruno] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

Just curious, wouldnt it be easier for your users if they did not have to check the botton OVERRIDE META, i think it is double work.

You can just get articlemanager to check if they have filled out the fields with the matadescription.

Use code :
<!-- templateIf : $article.metaKeywords$ ne "" -->
<META name="keywords" content="$article.metaKeywords$">
<!-- /templateIf -->

<!-- templateIf : $article.metaKeywords$ eq "" -->
<META name="keywords" content="your own metamagic">
<!-- /templateIf -->

This would check if the field is filled out or not.
This is the way i would go.


bruno
User

Feb 11, 2007, 3:14 PM

Post #3 of 7 (344 views)
Shortcut
Re: [diness] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

Yes... you are correct, this would be a great option.

The main reason that I'm choosing the check-box is to make the ArtMan admin more user friendly. If it's a checkbox, then it's intentional... but if it just says "Meta Tags (Optional)" I feel like it's less foolproof.

Anyway, any reason why it's not working? Is something missing from my code?


diness
User

Feb 11, 2007, 3:26 PM

Post #4 of 7 (341 views)
Shortcut
Re: [bruno] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

You might wanna wait for the support staff to take a look at it.

Have you checked that your database field is correct?

The field shall be checkbox, string, check value = yes, unchecked value = no,

Also are you sure the placeholder name is correct? Have you tried printing out the value
outside the template if?


bruno
User

Feb 11, 2007, 3:36 PM

Post #5 of 7 (336 views)
Shortcut
Re: [diness] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

Figured it out...

Since I have the checkbox value storing as a string, I incorrectly used "==" rather than "eq" or "ne"...


ChetW
Staff


Feb 11, 2007, 4:24 PM

Post #6 of 7 (331 views)
Shortcut
Re: [bruno] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

Hi Bruno,

Thanks for the post!

I'm glad to hear that you have gotten this all worked out, if we can lend you a hand with anything in the future please feel free to ask. :)
Cheers,
Chet Woodside - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.



bruno
User

Feb 11, 2007, 6:24 PM

Post #7 of 7 (323 views)
Shortcut
Re: [diness] Overriding a default META tag with "templateIF"... [In reply to] Can't Post

Another advantage to activating the meta tags with a check box is that you can still store the data. The description and keywords can be stored for editting, and activated with the check box.

This technique is also working well for the display of an article side-bar that can be turned on / off.

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4