Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Limit Description By Number Of Characters

edited March 2012 in Vanilla 2.0 - 2.8

I see that Vanilla doesn't want to break the description (meta tag), so after a certain number of characters it looks for the first 'period', and marks the text as description.

But I would like to set it this way - - show 160 characters of text followed by '...' For example, like this:

I see that Vanilla doesn't want to break the description, so after a certain number of characters it looks for the first 'period', and marks the text as descri...

How do I do that?

Answers

  • 422422 Developer MVP

    I posted this the other day, want me to give you the code?

    Search google for truncate.js

    There was an error rendering this rich post.

  • 422422 Developer MVP
    edited March 2012

    [ removed , not needed by user ]

    There was an error rendering this rich post.

  • 422422 Developer MVP
    edited March 2012

    [ removed , not needed by user ]

    There was an error rendering this rich post.

  • @422 : Thanks a lot for trying to help. But I was talking about the 'description' meta tag. i.e.

    <meta name="description" property="og:description" content="The web page's description goes here." />
    

    And I don't think it's a good idea to generate that (meta tags) with JavaScript/jQuery even if it's at all possible. Any PHP help please?

  • 422422 Developer MVP

    where did you say the meta description tag in your initial post ?

    "
    This META tag should contain 150 characters or less, and like the title META tag, your description should be relevant to the web page.
    "

    Basic SEO

    There was an error rendering this rich post.

  • @422 : Sorry about that. I didn't realize that it could be understood the other way.

    Coming to the point, okay, then I want my meta description's content like this: 147 characters followed by...

    How do i do that?

  • 422422 Developer MVP

    Why would you add ... for though ? its a meta tag.

    There was an error rendering this rich post.

  • edited March 2012

    I meant like this:

    <meta name="description" property="og:description" content="The web page's description goes here..." />
    

    EDIT: Okay, I get your point. How do I do it without that at least? :)

  • 422422 Developer MVP
    edited March 2012

    On Dynamic metas ? or what ??

    Ive never found vanilla that good with Metas.

    You could use php.

    And create a comprehensive meta file ( dynamic )

    See: http://webuyscrap.com.au

    We are running a dynamic metas system on this site for the client at the moment, it needs tweaking but we are running other tests to see how it performs on a la google.

    If your description tags are pulled directly from forum pages, then handling it shouldnt be too complex.

    However OG ( is generally for facebook ) so the use of dynamic content in this tag is easy to control, because ... it generally is user defined

    There was an error rendering this rich post.

  • edited March 2012

    Vanilla 2.1a automatically creates meta tags. It's just that I don't like how the description meta tag content is generated.

    Some descriptions are short, some are fine. The PHP used looks for the first 'period' ( . ) after a certain number of characters and generates a description with that text. I want to alter it so that the description is simply 150 characters.

    PS: I don't know PHP. If I did, I wouldn't be here. :(

  • 422422 Developer MVP
    edited March 2012

    Ok im on old vanilla version, i should upgrade huh

    ..edit ? 2.1 ?.

    There was an error rendering this rich post.

  • edited March 2012

    @422 : Yes. I'm running the unstable release. Reporting issues, and fixing some. :) It isn't too unstable IMO, compared to v2.0.18.4.

Sign In or Register to comment.