Forum

Thread tagged as: Question, Blog, Twitter

Blog post title - Remove/replace certain characters - perch:blog id="postTitle"

Hi,

My client has social media buttons on there blog, They are putting #'s within there titles. The problem is they are using custom social media share buttons, and the # is causing problems with the social media share links as they are using hte blog title as the share text.

I was wondering if there is a way to replace certain characters for something else or strip them using the \

<perch:blog id="postTitle" /> 

tag. I mainly work with .net so i would do something along the lines of

((string)Eval("postTitle")).Replace("a", "b") 
ltjfan site

ltjfan site 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

<perch:blog id="postTitle" replace="a|b" /> 

https://docs.grabaperch.com/docs/templates/attributes/replace/

Perfect, not sure how i missed that earlier when looking in the docs.