Jump to content
TNG Community

(SOLVED!) Templ 15: How Keep Footer in mobile mode


XerxX

Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
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

Link to comment
Share on other sites

Totally jumbled everything up!

Disregard this post. Thanks

 
 
 
<?php
//                $flags['basicfooter'] = true;
//                echo tng_footer($flags);
                include("stdsitecredit.php");
                echo $sitecredit;
?>
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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..?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...