News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Pelikan Theme

Started by gecitli, June 01, 2021, 12:18:14 PM

Previous topic - Next topic

Antechinus

Quote from: Julius_2000 on September 09, 2022, 07:56:19 AMIs the logic behind the href="something" that it would grab the first thing of that element it finds?
As far as I know, yes, but the HTML specs are a bit brain-frying to read.

QuoteLike what you said with your fool-proof hashtag-only approach? So, does it jump right to the first # it sees in the Html code?
No. The hashtag-only thing is part of the HTML specs. It will jump to the top of the page even if there are no id's at all on the page.* It's built in to HTML that # always goes to the top of the page. Ditto for #top, even if there is nothing actually named id="top" in the markup. :)

This is why in javascript you will often see something like this on a clickable element:
<a href="#" onclick="javascript:myFunc()">onclick</a>
The anchor needs a href to automatically be clickable but if you want people to be able to click it without the page jumping you have to include something like preventDefault() in your click function (to stop the default behaviour, which is jump to top).

Julius_2000

Thanks for the clarification! I'm learning a lot thanks to you guys.

Julius_2000

Hi all, just wanted to report a bug/ fix for Pelikan theme:

I reported a general bug to SMF forum about the missing/ wrong icon for the login popup header for the visitor/ guest (javascript) login. SMF corrected the code in the Subs.php file that was missing the 'loign' addendum to the javascript which resulted in a wrong class (main_icons help instead of main_icons login).

https://www.simplemachines.org/community/index.php?topic=584032.0
https://github.com/SimpleMachines/SMF/pull/7585/files#diff-6abd038855dcfe48a9c579b068758effd5314f6a0f4f4438a310305a9c14ae00L5545-R5545

Because Pelikan Theme uses a different HTML element called "Visitor" for guests, the general fix won't affect the theme and thus needs to be adapted as well in the Index.Template.php file
Quote// Otherwise they're a guest. Ask them to either register or login.
    else
    {
        echo '
            <ul class="user-menu menu menu--flat" id="top_info">
                <li class="visitor">
                    <a class="login" href="', $scripturl, '?action=login" onclick="return ', empty($maintenance) ? 'reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ', \'login\')' : 'true', ';"><i class="fas fa-right-to-bracket"></i> <span class="header__user-panel-text">', $txt['login'], '</span></a>
                </li>';

Also, the definition for .main_icons.login::before is not set in Pelikan making the header missing the icon and background color entirely.

Volker S

How do you fold in a category in this theme (Forum version 2.1.3)?
The "BoardIndex.template.php" provid this, as with many other themes.

For example: Jolla Tablet is hidden - but does not work in this theme.

Julius_2000

Do you mean the boards should be able to collapse (toggle up/ down)?

If so, I believe the author of this theme removed the collapse function.

Volker S

#25
That would be one explanation, although there are still pieces of code from the shrink in Boardindex.template.php:
<div class="main_container p-2 space-y-2 bg-white rounded-lg shadow">
<div class="items-center px-4 py-2 space-x-4 text-white rounded-lg shadow bg-gradient-to-r from-purple-700 to-purple-600 ', $category['is_collapsed'] ? 'collapsed' : '', '" id="category_', $category['id'], '">
               
<h3 class="catbg">';

// If this category even can collapse, show a link to collapse it.
if ($category['can_collapse'])

echo '
<span id="category_', $category['id'], '_upshrink" class="', $category['is_collapsed'] ? 'toggle_down' : 'toggle_up', ' floatright" data-collapsed="', (int) $category['is_collapsed'], '" title="', !$category['is_collapsed'] ? $txt['hide_category'] : $txt['show_category'], '" style="display: none;"></span>';

echo '
', $category['link'], '
</h3>', !empty($category['description']) ? '

<div class="desc">' . $category['description'] . '</div>' : '', '
</div>
<div id="category_', $category['id'], '_boards" class="divide-y divide-gray-200" ', (!empty($category['css_class']) ? ('class="' . $category['css_class'] . '"') : ''), '>';
and 'grayed out' is the category heading still there. See that Link from my Testforum (Access: testuser / test).

Julius_2000

#26
Yep, I'm aware, I use the same theme. I believe the author made a half-baked removal of the code.

The reason the category for the Allgemeine Diskussionen board (which is actually a seperate forum) is grayed out is because of these CSS lines:

.collapsed {
      opacity: .5;
      transition: 1s;
}

.collapsed:hover {
      opacity: 1;
}

The residual code was meant for actual collapsible boards. Which would make sense because only a collapsed board should have an opacity below 1 and 1 when hovered over.
What you could do is: Either edit the above CSS code or make the board non-collapsible in Admin/Forum/Boards & Categories/ Modiy Boards. I had the same issue and this helped.

Julius_2000

Hi

I just realized that this theme somehow does not provide the search box where you can also select "in topic" searches. The search button in the menu strip only redirects to the general search page where no such option exists.

Has this function/ box only been disabled or permanently removed?

Steve

That's likely intentional as another theme I use worked the same way, i.e., no search box.

Hextech was designed the same way. See the topic starting here: https://www.simplemachines.org/community/index.php?topic=583511.msg4134585;topicseen#msg4134585
DO NOT pm me for support unless asked to!

Julius_2000

Ah, thanks! That sucks since it's a useful tool if you want to just search a large topic.

Now I'm working on getting it back, which I'm partially successful of. The only struggle I have is that the search box is a form and I had to learn that nested forms are not allowed. So now I have to find a way to get it to place the box where I want it to be.

Julius_2000

Thank you, @Steve, for putting so much effort into helping me, that's really appreciated! Since the theme only served as the foundation (I have heavily customized it) it wouldn't fit with current look.
I pushed and shoved some of the elements (moderationbuttons, pagesection) out of the post container "form" in MessageIndex.template.php as well as Display.template.php and placed the search box above the pagesection at the bottom of the topic index/ topics like this:

You cannot view this attachment.
You cannot view this attachment.

So far, it seems working. I had to adjust quite a couple of index/responsive.css selectors as well, though.


Steve

Sorry, I had just deleted my post because it wasn't putting the search box where I wanted.
DO NOT pm me for support unless asked to!

Advertisement: