Add location in mobile view?

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
Willoughby_wx
Registered User
Posts: 112
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Add location in mobile view?

Post by Willoughby_wx »

Hi there,

Does anyone know how I would add the location after the user's name in the compacted mobile view?
location.PNG
As above.

Kind regards
Willoughby
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Add location in mobile view?

Post by david63 »

What is it that you want as the location - the data that the user has entered in their profile or using an app to find it automatically?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
PlanetStyles.net
Former Team Member
Posts: 4809
Joined: Wed Nov 04, 2009 11:16 pm
Location: Way up in the sky close to the stars
Name: Christian
Contact:

Re: Add location in mobile view?

Post by PlanetStyles.net »

Hello :)

In viewtopic_body.html, find:

Code: Select all

<!-- EVENT viewtopic_body_postrow_rank_after -->
After, add:

Code: Select all

<dd style="clear: both; margin: 0; display: none;" class="responsive-show">Something</dd>
This will only show your content in the responsive layout in the location you chose.

If you'd like it to show on the regular desktop layout too, then remove display: none; and class="responsive-show" from the snippet above :)
Willoughby_wx
Registered User
Posts: 112
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Re: Add location in mobile view?

Post by Willoughby_wx »

Christian 2.0 wrote: Sun Dec 10, 2017 9:57 am Hello :)

In viewtopic_body.html, find:

Code: Select all

<!-- EVENT viewtopic_body_postrow_rank_after -->
After, add:

Code: Select all

<dd style="clear: both; margin: 0; display: none;" class="responsive-show">Something</dd>
This will only show your content in the responsive layout in the location you chose.

If you'd like it to show on the regular desktop layout too, then remove display: none; and class="responsive-show" from the snippet above :)
Thank you! However I'm having lots of trouble getting the string for the user's location. As a test I used {postrow.POSTER_JOINED} which displayed fine when compact.

Basically I want this string:
location_highlighted.JPG
Up here when compact:
whatiwouldlike.JPG
I have tried a few of those fields below POSTER_WARNINGS but nothing displays :(

I have upped the code to github, but it's off a fresh clean upgrade. https://gist.github.com/anonymous/f7db1 ... 8193a53bfc

Thank you so much
Willoughby_wx
Registered User
Posts: 112
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Re: Add location in mobile view?

Post by Willoughby_wx »

I've figured it out. :)

Find in viewtopic_body.html:

Code: Select all

<dd class="profile-custom-field profile-{postrow.custom_fields.PROFILE_FIELD_IDENT}"><strong>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</strong> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
Add after on a new line:

Code: Select all

<dd style="clear: both; margin: 0; display: none;" class="responsive-show"> {postrow.custom_fields.PROFILE_FIELD_VALUE}</dd>
Thanks Christian 2.0 for doing the groundwork hehe
User avatar
PlanetStyles.net
Former Team Member
Posts: 4809
Joined: Wed Nov 04, 2009 11:16 pm
Location: Way up in the sky close to the stars
Name: Christian
Contact:

Re: Add location in mobile view?

Post by PlanetStyles.net »

Indeed, location is added through the custom fields. Awesome that you've been able to figure this out :)

Best of luck with your forums!
Post Reply

Return to “[3.2.x] Styles Support & Discussion”