2 Points on main_news
Posted
#5498
(In Topic #1276)

Standard member

1. How to make the icons in main_news clickable and link it to the news categories ?
2. How to make the main_news page in 10 or 15 news on the main page and the rest news on other pages 2,3,4 … etc. ?
Regards
Posted

Standard member

Regarding your first question, this works for me:
1. Copy NEWS_BOX.tpl to the templates_custom folder of the theme you are using or use the template dropdown in the footer of any Composr page and select same from the list which will open an editor.
2. At my end it's line 31 that needs the modification but look for the following in case it's different for you:
Code
<img src="{$ENSURE_PROTOCOL_SUITABILITY*,{IMG}}" alt="" />
Code
<a href="{$BASE_URL}/index.php?page=news&type=browse&id={CATEGORY}"><img src="{$ENSURE_PROTOCOL_SUITABILITY*,{IMG}}" alt="" /></a>
4. Generally not necessary, but whenever I'm modifying templates and things don't quite appear as I expect them too, I clear caches just to be sure. Fastest way for me is to open
Code
your_url/upgrader.php
I don't fully understand your second question so when you get a second and explain further I might be able to assist there too.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved
just peace, unity, tolerance and love" - The Beloved
Posted

Standard member

"An error has occurred
The requested resource does not exist. It has probably been deleted. "
In second question I mean how to be the posts on news page only 10 or 15 posts displayed and the rest of posts can be navigated by numbers at the button page.
Last edit: by fares9
Posted

Site director

Try:
Code
<a href="{$PAGE_LINK*,_SEARCH:news:browse:{_CATEGORY}}"><img src="{$ENSURE_PROTOCOL_SUITABILITY*,{IMG}}" alt="" /></a>
It's better because page-links work with all URL schemes. I think the issue you had though is SoccerDad assumed that the category URL monikers were the same as the category titles, which isn't guaranteed. So I am passing the numeric category ID into the page-link.
2.
Here's how to do it on the add/edit block form…
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- 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.
Posted

Standard member


"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved
just peace, unity, tolerance and love" - The Beloved
1 guest and 0 members have just viewed this.