Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-05-13 09:10:15
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
SEO Advice for Txp site
Can anyone offer any help?
I have 3 different static sites built in txp each in a seperate subdir. www.mydomain/site1,2,3.
Because the sites are more or less static I have setup different sections and applied sticky articles too each. The nav then points to each section. This works fine but I can’t for the life of me get specific meta data to generate. I guess because I’m going to a section rather then a specific article. Is there any way to pull specific article data to generate meta even if your just navigating to sections???
Will I need to re-structure the sites a bit the achieve this?
Are there any clever conditionals I could use to grab the meta?
Tried rah_metas and it has a good default option but because all my pages are sections the meta would end up being the same in each page/
Offline
Re: SEO Advice for Txp site
It’s not very efficient but if you want different met/section you couldn’t you use
<if_section name="name1">
<meta name= .... />
<meta name= .... />
...
</if_section>
<if_section name="name2">
<meta name= .... />
<meta name= .... />
...
</if_section>
<if_section name="name2">
<meta name= .... />
<meta name= .... />
...
</if_section>
etc
It would be more efficient if you used pages where you could use the keywords field either as meta keywords or meta description or meta anything:).
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: SEO Advice for Txp site
There are a few different approaches, some of them based on colak’s suggestion.
But you can also try something like this, taking advantage of the tags on tags powers:
<txp:if_article_list>
<!-- if we are on an article list, probably a section or a category or a search results page -->
<!-- create a variable containing the section meta description. The content comes from the excerpt of an sticky article on that section. Be sure there is only one sticky article on that section. If not, you will need to use another kind of filter, like a custom_field, for example, to get the particular article where the meta description from the current section is located. In any case, the idea/trick is to manage the metadata from within an article belonging to current section. -->
<txp:variable name="section_description" value='<txp:article_custom limit="1" status="sticky" section=''<txp:section />''><txp:excerpt /></txp:article_custom>' />
<!-- Same for keywords-->
<txp:variable name="section_keywords" value='<txp:article_custom limit="1" status="sticky" section=''<txp:section />''><txp:keywords /></txp:article_custom>' />
<!-- now, we fill rah_metas with the above variables (remember we are still on an article list) -->
<txp:rah_metas description='<txp:variable name="section_description" />' keywords='<txp:variable name="section_keywords" />' />
<txp:else />
<!-- we are on an individual article -->
<!-- just use rah_metas as you wish... look in the plugin help for more details... -->
<txp:rah_metas ... />
</txp:if_article_list>
This is just the beginning, there are a few ways to achieve this, and even a few ways to write the above code. Feel free to ask…
Offline
#4 2009-05-13 15:09:52
- mrjysta
- Member
- Registered: 2008-09-22
- Posts: 89
Re: SEO Advice for Txp site
Ah not used variables before! This looks like a nice solution/ gone with custom fields using the following:
<txp:if_section name="">
<txp:article_custom section="home" status="sticky" form="RTP_meta" />
<txp:else />
<txp:if_individual_article>
<txp:article form="RTP_meta" />
<txp:else />
<txp:article status="sticky" form="RTP_meta" />
</txp:if_individual_article>
</txp:if_section>
Then in my form:
<title><txp:page_title /></title>
<meta name="description" content="<txp:custom_field name="meta_desc" />" />
<meta name="keywords" content="<txp:keywords />" />
This seems to get me the meta descriptions and keywords how I want.
I have applied <txp:password_protect /> to the site whilst its being developed. Will this prevent google from indexing the site properly?
Last edited by mrjysta (2009-05-13 15:14:28)
Offline
Pages: 1