Jump to content
TNG Community
XerxX

Templ 15: How Keep Footer in mobile mode

Recommended Posts

XerxX

Hi all,

TNG 12.3

How can I keep the footer when sitever=mobile in template 15?

I want to keep it at least on the index page.

TIA

/Erik

Share this post


Link to post
Share on other sites
Newfloridian

Hi Erik

I'm not sure whether this would answer your needs. I absolutely and utterly detest mobile mode in all its versions. Using template 4 it destroys the header and the left hand navigation column. Actually though it seems to leave the footer alone. I don't cater for mobile mobile in my writings but I am aware that it is there.

Anyway after requests from several of my readers, I was able to offer an option which only appears in mobile mode - and that is to switch the view back to standard mode. (I have always found that, if you really have to, the standard view is acceptable if the mobile phone is held in landscape orientation.)

This is a modification of a device which Ron Krzy uses on his own site (he has it appearing in both the header and the footer). I place it in the footer only as an include statement so that it will appear on every page. On a mobile device in mobile mode it displays a "switch to standard" button and in standard mode it displays a "switch to mobile" button. Nothing displays on a PC, laptop or tablet.

Cheers Alan

    

switch.php

Share this post


Link to post
Share on other sites
XerxX

Hi Alan,

Thanks for the suggestion. I agree with you for the index pages. But for the rest, I find it very good (maybe the "Mobile..." mods are also responsible ;-) )

So I designed a totally responsive index page that looks the same for mobile mode or not, at different screen widths. Except that the footer disappears and as it contains some info I want to communicate I want to keep it. But I can't find out how or where.

This is what the footer looks like on a wider screen (made to fit here):

Skärmavbild 2020-05-23 kl. 10.04.52.png

This is on a narrow one - that I want but is gone:

Skärmavbild 2020-05-23 kl. 10.04.12.png

Oooh! A misspelling... Not good.

Regards,

Erik

 

Share this post


Link to post
Share on other sites
Ken Roy

Erik,

You might be able to set the $flags['nomobile'] = true;

before line 67 in the template 15 footer before the tng_footer function call.   Note that I have not played with this flag option.

Share this post


Link to post
Share on other sites
XerxX

Hi Ken,

Thanks for the suggestion! I put it here:

                $flags['basicfooter'] = true;
                $flags['nomobile'] = true;
                echo tng_footer($flags);


...but it didn't work: No footer I'm afraid:

Skärmavbild 2020-05-23 kl. 12.01.26.png

(Yes; I cleared the cache ;-) )

Have a nice weekend!

Erik

Share this post


Link to post
Share on other sites
XerxX

Thanks Brent, it worked - almost ;-)

Skärmavbild 2020-05-23 kl. 16.22.54.png

I inserted the include() and deleted the original mobile part, because I thought it was the same as below... just an include. Right?

Wrong! It looped making a quadrillion footers before it stopped :-D

So; in footer.php I had to remove these two:

                $flags['basicfooter'] = false;
                echo tng_footer($flags);

Keeping either one ended the same way.

I'll make Darrins std-credits appear one way or another.

Have a nice weekend!

Erik

Share this post


Link to post
Share on other sites
tngrlkrz
7 hours ago, Newfloridian said:

This is a modification of a device which Ron Krzy uses on his own site (he has it appearing in both the header and the footer).

Actually the full name is Ron Krzmarzick, ...Krzy likely from an email handle.  If anyone has interest in the 'switch mobile/standard' on all pages, top and/or bottom, message me.  To see effect, just click to my website in the signature below.

Share this post


Link to post
Share on other sites
Newfloridian

My profound apologies, Ron. Must have been the very early morning and a week long fight with my ISP which was finally resolved in the early hours!

Alan

Share this post


Link to post
Share on other sites
XerxX

Totally jumbled everything up!

Disregard this post. Thanks

 
 
 
<?php
//                $flags['basicfooter'] = true;
//                echo tng_footer($flags);
                include("stdsitecredit.php");
                echo $sitecredit;
?>

Share this post


Link to post
Share on other sites
tngrlkrz

This is still patchwork, and likely there's a better way to do it, but this tested out OK on tng12.3.   Erik, I think you wanted index/homepage only,  however the attached mod will display a button for switch standard/mobile on any template, as well as the bottom text articles for template 15 in both modes on all pages.  It's an unfinished mod, since in addition to installing the cfg fle, you must place footer2.php in folder template 15.  It tested OK with the Mobile Site Enhancement mod installed.  I don't use template 15 personally, so not sure all is OK with it.

It seems to avoid the footer looping problem you experienced (and so did I).

Ron

 

 

 

 

footer2.php

switch_button.cfg

Share this post


Link to post
Share on other sites
cfj

Hi Erik. Welcome back.

I have made som changes in both genlib and stdsitecrredit, since I use WordPress, but if you don't, you can just copy the code from your template footer into stdstitecredit.php

Hope that resolve the problem.

image.png

Share this post


Link to post
Share on other sites
XerxX

Hi guys, thanks for your replies.

While I was editing the post I got locked out and couldn't connect until now. Crazy.

So here's my solution:

===============

Target: genlib.php

%location:%
            echo tng_basicfooter($flags);
            if(!isset($flags['nomobile']) || !$flags['nomobile'])
                 echo "</div>\n";
%end:%
%replace:%

/*

            echo tng_basicfooter($flags);
            if(!isset($flags['nomobile']) || !$flags['nomobile'])
                 echo "</div>\n";
*/
            include( $templatepath . $customfooter );

%end:%

===============

Target footer.php

%location:%    
                $flags['basicfooter'] = true;
                echo tng_footer($flags);
%end:%
%replace:%

//                $flags['basicfooter'] = true;

//                echo tng_footer($flags);
                include("stdsitecredit.php");
                echo $sitecredit;

%end:%

============

BTW: The middle column in the footer should also have a width of 33% - it seems unnecessary but it isn't when I look at it in Firefox...

 

Thanks for your concern!

Erik

PS How do I edit the header to say "Solved"? I've done it once before but I see no option now..?

Share this post


Link to post
Share on other sites
DelG

for what is worth check my footer. i forget the details but adapted a premade mplate and all seems to work well for more than a year. hafd a stroke 23Apr and still in hospital so unlikely to be of further help. good luck.

Share this post


Link to post
Share on other sites
tngrlkrz

Del,

6 hours ago, DelG said:

hafd a stroke 23Apr and still in hospital so unlikely to be of further help. good luck.

Profound wishes for good health and a  speedy recovery.

 

Share this post


Link to post
Share on other sites
Rob Severijns

DelG,

 

Hope  you have a full recovery or at least have the side effects limited to an absolute minimum.

Wish you and your family all the best and hope to see you back soon.

 

Rob

Share this post


Link to post
Share on other sites
Chris Lloyd

All the best DelG. Speedy recovery.

Share this post


Link to post
Share on other sites
Ken Roy

Speedy recovery, Del!

Share this post


Link to post
Share on other sites
XerxX

Del,

Thanks for your reply. I solved it but couldn't post here for a day.

And even worse: We decided to skip that footer totally - sorry to all for engaging you for nothing!

I wish you a speedy and full recovery, Del.

Best regards,

Erik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×