aks_meta

Current version: 0.2.4

Support forum: English
Download: aks_meta

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 />

Changelog

v0.1 (2012-01-20)

v0.2.2 (2013-10-23)

  • Added tag aks_meta_head
  • Added tag aks_meta_rel

v0.2.4 (2016-09-26)

  • Txp 4.6 fix

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

.

<txp:aks_meta_head /> is a single or a container tag – Allows you to insert any text/css/js in html_head section. For sample:

<meta name=“robots” content=“noindex,follow” />
attributes default sample description
name @’‘@ @‘some’@ Optional, used only for overwrite previous definition
value @’‘@ @’‘@ Text

.

<txp:aks_meta_rel /> is a single or a container tag – Allows you to insert <link rel=.../> in html_head section. For sample:

<link rel="prev" title="my prev article" href="http://..." />
<link rel="next" title="my next article" href="http://..." />
<link rel="canonical" href="http://..." />
attributes default sample description
name @’‘@ @‘next’@ <link rel='name' ... />
title @’‘@ @‘next article’@ Optional
url @’‘@ @‘http://…’@ URL