solved Selecting "Newest Posts" tab from "All" on Home Page

Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
I want the "ALL" on the Latest Forum Posts block on my home page to go to the Newest Posts tab, not the "All Forums" tab.

My first thought was to modify the URL by explicitly adding the URL I get when clicking on the Newest Posts tab, as can be seen below (in the href).

<h2>{jrCore_lang skin=$_conf.jrCore_active_skin id="20" default="Latest"} {jrCore_lang skin=$_conf.jrCore_active_skin id="47" default="Forum"} {jrCore_lang skin=$_conf.jrCore_active_skin id="48" default="Posts"}{if strlen($_conf.nsTCLSkin1_forum_profile) > 0}   <span class="normal"><a href="{$_conf.nsTCLSkin1_forum_profile}/new_posts">{jrCore_lang skin=$_conf.jrCore_active_skin id="30" default="All"}</a></span>{/if}</h2>

This takes me to my profile, which I don't want. I want to go to the main forums page with the Newest Post tab selected.

Possible?
updated by @claygordon: 03/03/15 12:22:05PM
brian
@brian
9 years ago
10,148 posts
The "main forums" are on a profile - all forums are on a profile. It looks like it is already setup with the right URL:

{$_conf.nsTCLSkin1_forum_profile}/new_posts

Go into your Skin config and make sure the URL to the site forum is correct, and that will link directly to the "newest posts".

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
@Brian

I know this works but it's not taking me where I want. I don't want to go to Newest Posts on my profile page as the context is wrong.

I want to go to the place where I click "All" on the home page, and then manually select the "Newest Posts" tab as can be seen in the attached.

I am collapsing the extra click into the code. I know this is possible - you do it all the time in the ACP - I just don't know how to do it.

One place is in ACP > Users where you present the option of going to the Account tab or the Profile tab ... okay, there's the clue. Looking at the desktop headers menu ...

<li>{jrCore_module_url module="jrProfile" assign="purl"}
{jrCore_module_url module="jrUser" assign="uurl"}
<a href="{$jamroom_url}/{$purl}/admin/tools">users</a>
<ul>
<li><a href="{$jamroom_url}/{$purl}/quota_browser">quota browser</a></li>

I am guessing I have to build on that approach, just not entirely clear how to do it.

-- edited to add photo --
updated by @claygordon: 01/24/15 08:15:43AM
brian
@brian
9 years ago
10,148 posts
The end result is the exact same URL - the only issue I see on your site is that the profile "sidebar" shows if you do NOT come in from the "Forums" menu option - is that what you're seeing?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
Brian -

Yep, the final URL is exactly the same.

If I go to it directly via clicking on a URL or entering it into browser location field, I go to my profile.

However, if I click on Forums in the top nav and then click on the Newest Posts tab, I stay on the site Forums page - I don't go to my profile Forums page.

I want to stay on the site Forums page. The screenshot attached.
brian
@brian
9 years ago
10,148 posts
thechocolatelife:
However, if I click on Forums in the top nav and then click on the Newest Posts tab, I stay on the site Forums page - I don't go to my profile Forums page.

Just to clarify, you are always on your profile. The only difference is that the profile "sidebar" is being hidden on the first, and not the second - same URL, same forum, just a different layout :)

I've got your login here and will try to see why that is behaving differently and let you know.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
9 years ago
10,148 posts
I've got this fixed up for you on your site and will have the fix in the next NingJa release as well.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
Brian-

Just tested this and when I click on All from the home page it still goes to the Forum page with the Forums tab selected. I want the Newest Posts tab selected. I cleared caches.
brian
@brian
9 years ago
10,148 posts
thechocolatelife:
Brian-

Just tested this and when I click on All from the home page it still goes to the Forum page with the Forums tab selected. I want the Newest Posts tab selected. I cleared caches.

I just modified your "header_menu_desktop.tpl" file in the "Templates" section of your active skin and added:

/new_posts

to the end of the forum URL, so that's working now. Feel free to change it to suit your needs.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Clay Gordon
Clay Gordon
@claygordon
9 years ago
733 posts
Brian -

But that's not where I wanted it - but I like it there.

I took a look at what you did in the menu and then back again at what I did in the Latest Forums Post block and said, "What the heck, let's reset both the template and database caches (again) just to see if that made a difference." And it did. Works the way I want it to now.

Thanks.

-- edited to fix typos for clarity --

Another lesson on why it's important to switch into developer mode even when you think you are doing trivial stuff.
updated by @claygordon: 01/24/15 12:23:16PM
brian
@brian
9 years ago
10,148 posts
Sorry if that was in the wrong place - I must have misunderstood you, but glad it's worked out :)

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags