ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Remove Quote Marks from Content?

June 11, 2009 5:34pm

Subscribe [3]
  • #1 / Jun 11, 2009 5:34pm

    Big Skillet

    364 posts

    Is it possible to remove quote marks from a block of content?

    I’d like to insert the summary from each of my posts into the “description” metatag of my template.  The problem is sometimes there are quote marks in the summary content and it causes the metatag to break.

    Any suggestions on how to get rid of the quote marks?

  • #2 / Jun 11, 2009 7:30pm

    silenz

    1651 posts

    One way would be using the Cleaner plugin.

  • #3 / Jun 11, 2009 7:32pm

    lebisol

    2234 posts

    or add custom field…

  • #4 / Jun 11, 2009 7:33pm

    Big Skillet

    364 posts

    Wow, exactly what I needed.  Thanks!

    I had a friend write some PHP for me, but haven’t tried it yet:

    <?php
    $trimmed_content = substr($post->post_content, 0, 50); $meta_desc = str_replace("\"","", $trimmed_content); ?> <meta name="description" content="<?php echo $meta_desc; ?>" />
  • #5 / Jun 11, 2009 7:48pm

    lebisol

    2234 posts

    @silenz
    what about the single quotes? eg. don’t vs. dont vs. ‘hi there’
    Thanks for the link!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases