aks_meta


Current version: 0.1

aks_meta – Change metas after page rendering

download link / homepage / forum

Summary

Set or change html page <title>.. , <meta name="keywords"... , <meta name="description"...
on runtime inside any tags or including forms.

This will avoid a large(MONSTER) code in the

<head>
<txp:if_section...  <title><txp:title...   <meta name="keywords"...
<txp:if_category...    <meta name="keywords"...
<txp:if_individual_article...  <title><txp:title...
<txp:if_custom_field...    <title><txp:custom_field... 
other if...
</head>

Example:

<html><head>
<txp:aks_meta_title>My default site title</txp:aks_meta_title>
<txp:aks_meta_keywords>key1,key2</txp:aks_meta_keywords>
</head><body>
<txp:if_....><txp:output_form form="form1" />
...
...
<txp:aks_meta_title add="last" value="with love :)" />
</body></html>
<!-- form1 -->
<txp:aks_meta_title add="first" value='<txp:title />' />
<txp:if_....><txp:output_form form="render_data_from_external_store" />
<!-- render_data_from_external_store -->
rendering data...
<txp:aks_meta_title add="first">TitleFromExtStore</txp:aks_meta_title>
<txp:aks_meta_keywords add="last">KeysFromExtStore</txp:aks_meta_keywords>
<txp:aks_meta_description>DescriptionFromExtStore</txp:aks_meta_description>

Result in browser:

 <html><head>
<title>TitleFromExtStore :: form1 title :: My default site title :: with love :)</title>
<meta name="keywords" content="key1,key2,KeysFromExtStore" />
<meta name="description" content="DescriptionFromExtStore" />
...skip...

Remark:
Plugin store self data as ordinary txp:variable and you may use tags
<txp:if_variable name="aks_meta_title">... or <txp:variable />

Tags

<txp:aks_meta_title /> is a single or a container tag

attributes default sample description
add '' 'first' or 'last' Add or overwrite exist value
separator ' :: ' ' any_text ' Uses with add attribute
value '' 'my new value' Value or get value from container
strip 1 0 Strip html tags

.

<txp:aks_meta_keywords /> is a single or a container tag

attributes default sample description
add '' 'first' or 'last' Add or overwrite exist value
separator ',' ', ' Uses with add attribute
value '' 'my new value' Value or get value from container
strip 1 0 Strip html tags

.

<txp:aks_meta_description /> is a single or a container tag

attributes default sample description
add '' 'first' or 'last' Add or overwrite exist value
separator ' ' ' any_text ' Uses with add attribute
value '' 'my new value' Value or get value from container
strip 1 0 Strip html tags