DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • July 25, 2017, 03:39:31 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: 1 [2]   Go Down
  Print  
Author Topic: Requesting assistance with modernization of a new template  (Read 2082 times)
0 Members and 1 Guest are viewing this topic.
GRRRilla Ninja
Codemeister
****
Offline Offline

Posts: 321


View Profile
« Reply #15 on: March 02, 2017, 11:44:25 AM »

-= Update Snapshot =-


Currently the only barrier I'm running into is the problem with links outside the nav tree. I'm sure I will find more as I go on, but for now just the one!
Logged
Stephen.Kise
Codemeister
****
Offline Offline

Posts: 359


So meme'd up.


View Profile
« Reply #16 on: March 03, 2017, 01:38:58 AM »

I've already tried adding the {motd} and {petition} into an addnav inside village.php and it didn't work. What is PHP doing to the link that I can't replicate? Is there a part of the core code that forces the link to be called inside the addnav structure for security reasons?

This really depends on if you are going to have the {motd}, {mail}, etc as a header, or a navigation item. It seems like you are trying to make these pieces as a navigation item, instead of a header so I will answer accordingly. The navigation system automatically searches through any navigation added and attempts to assign a hotkey to it. Example: addnav('{motd}', false, false, true); may turn out to have the navigation link of "<em>{</em>motd}". In lib/pageparts.php, page_footer will try to replace {motd} it does not exist, except for in the template's definition. Instead, you want to force private_addnav() (it's what addnav() is passed through) to not mess with the link name ({motd}, {mail} or {petition} in this example) - which can be done with addnav('{motd}', '!!!addraw!!!');.

However, it seems as if you want the original definition of these template parts removed. This means you have to first remove it from the template itself and then add it after, so duplication does not occur. I would do this through a module - hook into everyfooter. An example of what the 'dohook' function should look like is below. (I saw no mention of {petitioncount} however. That is in the $footer global more than likely). Note that this example should work, I see no reason as to why it will not since the replacement comes almost immediately after the everyfooter hook.

Code:
<?php

function moduleName_dohook(string $hook, array $args): array
{
    global 
$header;
    
$templateParts = ['{motd}''{mail}''{petition}'];
    
// Remove the original so that lib/pageparts.php doesn't
    // leave the originals outside of the navigation stack.
    
str_replace($templateParts''$header);
    
// Move them inside of the navigation stack.
    
addnav('Other Info');
    foreach (
$templateParts as $key) {
        
addnav($key'!!!addraw!!!');
    }
    return 
$args;
}
Logged

Currently revamping the core for 7 and bringing back an open source wiki.
GRRRilla Ninja
Codemeister
****
Offline Offline

Posts: 321


View Profile
« Reply #17 on: March 04, 2017, 11:07:48 AM »

addnav('{motd}', '!!!addraw!!!')

This seems to work perfectly thank you Stephen.Kise
Logged
GRRRilla Ninja
Codemeister
****
Offline Offline

Posts: 321


View Profile
« Reply #18 on: March 09, 2017, 12:01:40 PM »

I thought I could embed a YT video in a post but I can't figure out how.

Here is a 4 minute video showing progress on the theme and giving thanks to Stephen.Kise and EliWood.

Thoughts? https://www.youtube.com/watch?v=hL9tcLQE5Wo
Logged
Anharat
Codemeister
****
Offline Offline

Posts: 259



View Profile WWW
« Reply #19 on: March 09, 2017, 10:53:21 PM »

Pretty interessting style, even if I think it feels a little less intuitive to handle, but that probably just something to get used to.

I really like it.
Logged

GRRRilla Ninja
Codemeister
****
Offline Offline

Posts: 321


View Profile
« Reply #20 on: March 10, 2017, 08:57:04 AM »

Thank you Anharat! I forgot to include "styling popup windows" in my future plans. I haven't decided whether I want to keep the current popup system or convert everything to modals like I did in my previous template.
Logged
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
31 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search