We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Remove formatting tags from title tag

How Do I?

Stewf's avatar
Stewf
4 posts
5 years ago
Stewf's avatar Stewf

Our blog often references publications, works of art, or other titles which require the <cite> tag in the headline. How can I omit these formatting tags from the automatically generated <title> for the head element of the page?

       
Stewf's avatar
Stewf
4 posts
5 years ago
Stewf's avatar Stewf

I was able to do this with Tag-Stripper.

       
Rob Allen's avatar
Rob Allen
2,950 posts
5 years ago
Rob Allen's avatar Rob Allen

In cases like this I’d always use a different field to replace the normal Title value where necessary.

       
Andrés Molina's avatar
Andrés Molina
43 posts
5 years ago
Andrés Molina's avatar Andrés Molina

if you need the same field for this, can use a custom plugin with php str_replace function

for example

public function replacedata(){
  $this->buscartxt = (ee()->TMPL->fetch_param('buscartxt'))?ee()->TMPL->fetch_param('buscartxt'):0;
  $this->reemplazatxt = (ee()->TMPL->fetch_param('reemplazatxt'))?ee()->TMPL->fetch_param('reemplazatxt'):0;
  $formtag = str_replace($this->buscartxt, $this->reemplazatxt, ee()->TMPL->tagdata);
  
  return  $formtag;
  
 }

and use in your template

<title>{exp:tcdcl_utilities:replacedata buscartxt="<cite>" reemplazatxt="" }{title}{/exp:tcdcl_utilities:getGridValues}</title>

tcdcl_utilities are the name of yur custom Plugin and replacedata the name of function

this replace only open tag cite , but you can custmize the function its only a simple example.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.