2 Points on main_news

Post

Posted
Rating:
#5093 (In Topic #1029)
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

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Chris Graham)
#5094
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. :)

Post

Posted
Rating:
#5095
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

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by SoccerDad)
#5100
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

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by Adam Edington)
#5104
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!

0 guests and 0 members have recently viewed this.