TinyPortal

Development => Support => Topic started by: [chrisB] on March 19, 2025, 09:49:07 PM

Title: A couple more questions (sorry) 😊
Post by: [chrisB] on March 19, 2025, 09:49:07 PM
As I have mentioned before, I use VBGamers Pretty URL Pro mod. (I know how many SMF users feel about it) 😆

I would like to add all the TinyPortal URLs to the sitemap it generates, with the following area being mentioned as needing to be modified.

$context['sitemap']['items'] = array();
The thing, I can only assume what should be there.

I know this code isn't correct, as I have tried it, but if someone could please amend it (no rush) - I would be very grateful.

    // TinyPortal Content
if (isset($modSettings['tp_enable_sitemap']) && $modSettings['tp_enable_sitemap'])
{
    // Add TinyPortal pages or blocks to the sitemap
    $context['sitemap']['items'] = array_merge($context['sitemap']['items'], pretty_TinyPortalXML());
}

I know this is a big ask, but having the URLs generated nicely with the sitemap would be nice.
----

Lastly, I did search here and I found a topic that seemed to be very similar. However, I wasn't sure how it would be applied in my scenario but honestly I do use the search function.
I even asked on SMF's forums here, but I still can't suss it out: https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692

I would like to sort out what shows as active when visiting.

Currently, the about page I created links to home, which has been described as the default behaviour but I don't know how to change this. Please could you explain how I can add the missing active tabs to my site, so I can get everything showing as active in the right area?
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 23, 2025, 10:21:34 PM
Quote from: [chrisB] on March 19, 2025, 09:49:07 PMI would like to add all the TinyPortal URLs to the sitemap it generates, with the following area being mentioned as needing to be modified.

Code Select Expand
$context['sitemap']['items'] = array();
The thing, I can only assume what should be there.

I know this code isn't correct, as I have tried it, but if someone could please amend it (no rush) - I would be very grateful.

Code Select Expand
    // TinyPortal Content
if (isset($modSettings['tp_enable_sitemap']) && $modSettings['tp_enable_sitemap'])
{
    // Add TinyPortal pages or blocks to the sitemap
    $context['sitemap']['items'] = array_merge($context['sitemap']['items'], pretty_TinyPortalXML());
}

I know this is a big ask, but having the URLs generated nicely with the sitemap would be nice.

Sorry, I do not know how this sitemap function works exactly, and I have no desire or time to find out.
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 23, 2025, 10:22:05 PM
Quote from: [chrisB] on March 19, 2025, 09:49:07 PMLastly, I did search here and I found a topic that seemed to be very similar. However, I wasn't sure how it would be applied in my scenario but honestly I do use the search function.
I even asked on SMF's forums here, but I still can't suss it out: https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692 (https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692)

I would like to sort out what shows as active when visiting.

Currently, the about page I created links to home, which has been described as the default behaviour but I don't know how to change this. Please could you explain how I can add the missing active tabs to my site, so I can get everything showing as active in the right area?

I will look into this
Title: Re: A couple more questions (sorry!) 😊
Post by: [chrisB] on March 24, 2025, 12:17:10 PM
Would you be able to point me in the direction of what line of code creates this, please?
(https://i.imgur.com/2vipxKF.png)

I assumed it would be the article.php file in sources, but I can't figure out what line is responsible. To make sense of why I seek it, I would like to add my site's name to it.

Title - Site Name

So, it's consistent throughout the main pages like this.
(https://i.imgur.com/heSQkdQ.png)

Quote from: @rjen on March 23, 2025, 10:21:34 PM
Quote from: [chrisB] on March 19, 2025, 09:49:07 PMI would like to add all the TinyPortal URLs to the sitemap it generates, with the following area being mentioned as needing to be modified.

Code Select Expand
$context['sitemap']['items'] = array();
The thing, I can only assume what should be there.

I know this code isn't correct, as I have tried it, but if someone could please amend it (no rush) - I would be very grateful.

Code Select Expand
    // TinyPortal Content
if (isset($modSettings['tp_enable_sitemap']) && $modSettings['tp_enable_sitemap'])
{
    // Add TinyPortal pages or blocks to the sitemap
    $context['sitemap']['items'] = array_merge($context['sitemap']['items'], pretty_TinyPortalXML());
}

I know this is a big ask, but having the URLs generated nicely with the sitemap would be nice.

Sorry, I do not know how this sitemap function works exactly, and I have no desire or time to find out.

No worries. 👍🏻
Quote from: @rjen on March 23, 2025, 10:22:05 PM
Quote from: [chrisB] on March 19, 2025, 09:49:07 PMLastly, I did search here and I found a topic that seemed to be very similar. However, I wasn't sure how it would be applied in my scenario but honestly I do use the search function.
I even asked on SMF's forums here, but I still can't suss it out: https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692 (https://www.simplemachines.org/community/index.php?topic=591292.msg4187692#msg4187692)

I would like to sort out what shows as active when visiting.

Currently, the about page I created links to home, which has been described as the default behaviour but I don't know how to change this. Please could you explain how I can add the missing active tabs to my site, so I can get everything showing as active in the right area?

I will look into this

Thank you, it's probably much easier than I think but I don't understand what I'm supposed to do.

PS. I hope you enjoyed your holiday, rjen, if you are still away, please don't take time out of it to respond to this now but thank you for your help as always.
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 02:10:42 PM
Quote from: [chrisB] on March 24, 2025, 12:17:10 PMWould you be able to point me in the direction of what line of code creates this, please?
(https://i.imgur.com/2vipxKF.png)

No clue what I am looking at here...
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 02:20:56 PM
Well I think you are referring to the Tab description in the browser..
It would help if you provided a clearer screenshot or description.

I am afraid I cannot help you here, because as far as I can see it is your custom theme doing stuff here.
In the standard Theme the extra stuff is not available , so it seems your theme has some extra stuff that does not play nice with TinyPortal..
Title: Re: A couple more questions (sorry!) 😊
Post by: [chrisB] on March 24, 2025, 03:59:49 PM
Quote from: @rjen on March 24, 2025, 02:10:42 PM
Quote from: [chrisB] on March 24, 2025, 12:17:10 PMWould you be able to point me in the direction of what line of code creates this, please?
(https://i.imgur.com/2vipxKF.png)

No clue what I am looking at here...

It's the title displayed on browser tabs.

Quote from: @rjen on March 24, 2025, 02:20:56 PMWell I think you are referring to the Tab description in the browser..
It would help if you provided a clearer screenshot or description.

I am afraid I cannot help you here, because as far as I can see it is your custom theme doing stuff here.
In the standard Theme the extra stuff is not available , so it seems your theme has some extra stuff that does not play nice with TinyPortal..


I have created pages using articles, which is what the 'about' page is. All I need to know is how to make them not fall back to the default which I have been told is the default action due to them not existing. I can confirm it happens in the default theme.

(https://i.imgur.com/hNvLdqp.png)

In this screenshot, that is the default theme (which can't be selected by non admins). The page is "about", created within TinyPortal but it shows the home as being active. I would like to make the menu item "about" active.

If I could understand where and how to achieve this, I could fix the other pages which don't exist in the standard SMF install.
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 04:05:02 PM
You are mixing two different questions now: I am stricktly referring to the question on "Title - Site Name", nothing to do with the highlighting of the menu options...
Title: Re: A couple more questions (sorry!) 😊
Post by: [chrisB] on March 24, 2025, 04:21:12 PM
Quote from: @rjen on March 24, 2025, 04:05:02 PMYou are mixing two different questions now: I am stricktly referring to the question on "Title - Site Name", nothing to do with the highlighting of the menu options...

So, let's focus on that then. What file generates the title for the browser tabs for articles (pages)?

https://poetryartonline.com/about/
https://poetryartonline.com/news/

When I create articles as pages, something within the TinyPortal code is saying to call the tabs what the name of the article is. Can you please tell me what part that is?

This has nothing to do with my theme.
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 04:28:52 PM
As I said it is your theme doing funny stuff adding site name to the tabs: that is NOT TinyPortal

QuoteI am afraid I cannot help you here, because as far as I can see it is your custom theme doing stuff here.
In the standard Theme the extra stuff is not available , so it seems your theme has some extra stuff that does not play nice with TinyPortal..

In combination with Pretty URLs all bets are of..

If you feel lucky, look in TPortal.php, look for $context['page_title']
Title: Re: A couple more questions (sorry!) 😊
Post by: [chrisB] on March 24, 2025, 04:40:32 PM
Are they picked up from the name then?

Usually, there's something like this in the code of the file that is responsible for generating it.
//Set the page title
$context['page_title'] = 'Title - ' . $mbname;
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 04:44:23 PM
I already said it...

look in TPortal.php, look for $context['page_title'].

I am guessing you want line 740
Title: Re: A couple more questions (sorry!) 😊
Post by: [chrisB] on March 24, 2025, 04:59:05 PM
Quote from: @rjen on March 24, 2025, 04:44:23 PMI already said it...

look in TPortal.php, look for $context['page_title'].

I am guessing you want line 740

Thanks rjen.

I didn't notice any references before. However, looking back now, I can see them. I am not suggesting that you edited your post, as I fully acknowledge that I may have simply missed it. If it was edited, that would explain why.

The code I seeked, is this.
$context['page_title'] = $context['TPortal']['article']['subject'];
(https://media1.tenor.com/m/lvAYBBSJUV0AAAAC/do-you-feel-lucky-punk.gif)
Title: Re: A couple more questions (sorry!) 😊
Post by: @rjen on March 24, 2025, 05:00:50 PM
I did edit my post... do not worry about it
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 25, 2025, 06:03:49 PM
Does TinyPortal generate any URL outputs, such as an RSS feed? I have read that there's an edit that does it for articles.

This would help me and vbgamer to automatically add URLs to the sitemap his mod generates.

I completely understand that it's not something you will look into yourself, but it sounds like my code would be almost functional if TinyPortal had something like this.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 25, 2025, 06:16:00 PM
I do not understand what you are asking. TinyPortal generates urls for Articles and Categories. Those you can add to a sitemap.

If you see an edit somewhere to do it, please link to the resource, I cannot read minds...
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 12:37:58 PM
I'll come back it, rjen.

Is it me, or a bug?

No matter what value I enter—be it 200px, 200, or 20% - the size on the article (page) doesn't change. I save the value, refresh the page, and the default size stays the same.

I can adjust it through CSS, but surely the value I input should override the default. Am I doing something wrong, or is this a bug?

(https://i.imgur.com/kPpsi3L.png)
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 12:38:55 PM
what does the article page size have to do with the panel sizes?
The screenshot is the setting for defining the WIDTH of the right and left panel, nothing to do with Articles
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 12:40:11 PM
..... It's the panel sizes I am trying to change, but just for that article - via the settings I shared in the screenshot.

-Edit-

If it has nothing to do with the article, why is it in that artcles settings nearer the bottom?

This is the link to edit the TP article: https://poetryartonline.com/tpadmin/?sa=editarticle;article=2
This is the link to the article page: https://poetryartonline.com/dashboard/

The values have no effect, unless I am entering them incorrectly.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 12:44:16 PM
Quote from: [chrisB] on March 26, 2025, 12:40:11 PM..... It's the panel sizes I am trying to change, but just for that article - via the settings I shared in the screenshot.

-Edit-

If it has nothing to do with the article, why is it in that artcles settings nearer the bottom?

Can I ask you to provide clearer screenshots going forward?
These settings are in multiple places, and bij just seeing a setting it does not tell me where you are...
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 12:47:20 PM
Yes, of course.

(https://i.imgur.com/ljpEibk.png)

Link: https://poetryartonline.com/dashboard/
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 12:49:59 PM
I need to investigate that.
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 12:51:32 PM
No worries, thanks for looking into it.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 01:07:59 PM
As far as I can see now those settings do nothing... so it may be a bug, or just some functionality that no one is missing, because it was never reported before...
Title: Re: A couple more questions (sorry) 😊
Post by: lurkalot on March 26, 2025, 01:16:37 PM
I've never noticed it before, but they are there for several versions back to at least TP 2.0.1 That's the oldest one I have running.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 01:21:05 PM
Quote from: lurkalot on March 26, 2025, 01:16:37 PMI've never noticed it before, but they are there for several versions back to at least TP 2.0.1 That's the oldest one I have running.

You mean, they ARE working in the old versions? If so, any chance that you can tell me what the newest version is where they worked?
It may be something that got broken when I rewrote the whole panels setup to work on flex instead of tables...
Title: Re: A couple more questions (sorry) 😊
Post by: lurkalot on March 26, 2025, 02:38:57 PM
Quote from: @rjen on March 26, 2025, 01:21:05 PM
Quote from: lurkalot on March 26, 2025, 01:16:37 PMI've never noticed it before, but they are there for several versions back to at least TP 2.0.1 That's the oldest one I have running.

You mean, they ARE working in the old versions? If so, any chance that you can tell me what the newest version is where they worked?
It may be something that got broken when I rewrote the whole panels setup to work on flex instead of tables...

No I mean they are there in older versions, I wouldn't use them anyway, and always set my global panel widths in the panels page.  I'll go try them in the versions I have and see if they do anything.

This Docs article was written in 2015 and last edited in 2020 and that shows the settings.  https://www.tinyportal.net/docs/index.php?page=Creating-an-article

Guess I ignored them for so long I don't even notice they're there.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 02:45:02 PM
I know the settings are there for a long time, but like you, I never used them.

TBH it is one of the many settings that I do not see being used. I appreciate the OP wants to use them, but I would propose to drop the article setting for the next version and not try to restore something that is not functioning...
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 02:54:02 PM
Quote from: @rjen on March 26, 2025, 02:45:02 PMI know the settings are there for a long time, but like you, I never used them.

TBH it is one of the many settings that I do not see being used. I appreciate the OP wants to use them, but I would propose to drop the article setting for the next version and not try to restore something that is not functioning...

To be fair, I can just use CSS. It's not a big deal to those the settings.
Title: Re: A couple more questions (sorry) 😊
Post by: lurkalot on March 26, 2025, 02:54:46 PM
They don't work for me in 2.1.0 either. ;)

I agree, seems pointless having them there, unless someone can come up with a good reason to have them.
Title: Re: A couple more questions (sorry) 😊
Post by: lurkalot on March 26, 2025, 03:02:05 PM
Quote from: [chrisB] on March 26, 2025, 02:54:02 PMTo be fair, I can just use CSS. It's not a big deal to those the settings.

Just curious, do you intend to run different content in the left and right panels on the article, to what you would on the home page or other parts of the site?
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 05:11:14 PM
It can be done quite easily with CSS: https://poetryartonline.com/dashboard/

It's just set up with blocks as I am testing the article page out, but I don't see why any other TP user couldn't replicate this per page if they wished.
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 06:27:49 PM
You might want to test your page on mobile devices as well...
Title: Re: A couple more questions (sorry) 😊
Post by: lurkalot on March 26, 2025, 06:52:30 PM
Quote from: @rjen on March 26, 2025, 06:27:49 PMYou might want to test your page on mobile devices as well...

Yes, just checked it in device emulation in EDGE. Something not quite right there.
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 07:49:54 PM
I didn't add any responsive CSS. 🤦🏻�♂️
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on March 26, 2025, 07:51:11 PM
I figured that much
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on March 26, 2025, 08:01:15 PM
Thanks for pointing the lack of it out. 👍🏻
Title: Re: A couple more questions (sorry) 😊
Post by: [chrisB] on April 01, 2025, 12:30:40 AM
(https://i.imgur.com/w3VVpLV.png)

I assume with the Optimus mod, the site links created with TinyPortal are included; is this correct?
Title: Re: A couple more questions (sorry) 😊
Post by: @rjen on April 01, 2025, 06:55:49 AM
No.

This is input voor TinyPortals Sitemap block

This is part of the TP docs: Sitemap - this shows any menu manager item you have selected in a sitemap block

Please note that although some mods have settings for Portals there are NO settings in TinyPortal that are specific to any other mod.
If possible we try to make TinyPortal not conflict with other mods but we do not specifically integrate with any.
We are not planning to either