Limit character length for new blurbs, etc.
  • I'm displaying some blog blurbs on the home page of a website I'm working on... I am just displaying the TITLE and a Read More link, but I want to limit the number of characters of the TITLE. If anyone could help, or provide some insight I would appreciate it. Thanks in advance.
  • You could try using the word_limiter or char_limiter functions from CodeIgniter:
    https://codeigniter.com/user_guide/helpers/text_helper.html
  • I'm not that savvy with PHP, but I'm fairly capable of manipulating FUEL. Do I add the CI scripts to the helper file? Or do I add it directly to the page I want the blurb to show up on. I'm not 100% clear on this probably because I'm a designer before coder. Hmmmm?
  • If it is a blog post object, you may be able to use one of the built in magic methods in the template:
    $post->title_excerpt(15)
  • thank you. had to add ' ' around the number but worked.

    $post->title_excerpt('50')

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!