News box

Post

Posted
Rating:
#1176 (In Topic #255)
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
After trying many forums and CMSs I am incredibly happy with composr. So many features.

One issue I did notice is when you post an article in news with an external image, where the image is larger than the text area, the image stays full size where the overflow of the image is hidden. As a temp fix i needed to include the following in the global.css.

.box img {
    border: 0;
    object-fit: contain;
    max-width: 725px;
}

Being new to composr though I am struggling to achieve the attached image for the main news block on the front page. And having it strip all html from the text.

Image

Untitled15.jpg

Untitled15.jpg

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#1178
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi Paul,

We'll consider a universal max-width rule for v11, I think people are expecting it now rather than setting image sizes.

You can strip out HTML in Tempcode using the STRIP_HTML symbol. Try this change in NEWS_BOX.tpl

Code

      {+START,IF,{TRUNCATE}}{$TRUNCATE_LEFT,{NEWS},400,0,1,0,0.4}{+END}
      {+START,IF,{$NOT,{TRUNCATE}}}{NEWS}{+END}

Code

      {+START,IF,{TRUNCATE}}{$STRIP_HTML*,{$TRUNCATE_LEFT,{NEWS},400,0,1,0,0.4}}{+END}
      {+START,IF,{$NOT,{TRUNCATE}}}{$STRIP_HTML*,{NEWS}}{+END}

The '*' is because it needs to be re-escaped after being converted into text.

Or, you could just set the news summary field manually to be plain for each article.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: Yes Back to the top

Post

Posted
Rating:
#1180
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Thankyou very much.

www.g4manic.com is my website, still a lot of work to go yet.
Thankyou for the fantastic software.

Last edit: by Paul Flavel

Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

MVLipwig, Chris Graham

Forum statistics:
  • 1,361 topics, 5,911 posts, 7,290 members
  • Our newest member is advanceayurveda
Birthdays:
Back to Top