2 Points on main_news

Post

Posted
Rating:
#5498 (In Topic #1276)
Avatar
Standard member
fares9 is in the usergroup ‘Fan in action’
Hi

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
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Chris Graham)
#5499
Avatar
Standard member
SoccerDad is in the usergroup ‘Community saint’
Hi Fares9!

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="" />
and change it to:

Code

<a href="{$BASE_URL}/index.php?page=news&type=browse&id={CATEGORY}"><img src="{$ENSURE_PROTOCOL_SUITABILITY*,{IMG}}" alt="" /></a>
3. Save that and give it a whirl
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
and click clear caches from there.

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
Online now: No Back to the top

Post

Posted
Rating:
#5500
Avatar
Standard member
fares9 is in the usergroup ‘Fan in action’
I have followed your instructions for my 1st question, but I got an error message when I click on the icon:

"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

Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by SoccerDad)
#5505
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
1.

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…
Screen Shot 2019-01-29 at 3.15.46 PM.png


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: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by Adam)
#5509
Avatar
Standard member
SoccerDad is in the usergroup ‘Community saint’
Good catch Chris on categories, thanx! Fares9, sorry to have lead you astray! On the upside we both learned something new today :) I have made Chris' suggested change on my end and can confirm that it works dandy!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

Paul D, amit.nigam, gabriel58, mytracker, MVLipwig

Forum statistics:
  • 1,064 topics, 5,138 posts, 5,981 members
  • Our newest member is narjisinfotech
Birthdays:
Back to Top