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: 100
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Add location in mobile view?

Post by Willoughby_wx » Sun Dec 10, 2017 1:52 am

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
Jr. Extension Validator
Posts: 15060
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Add location in mobile view?

Post by david63 » Sun Dec 10, 2017 8:44 am

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!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Christian 2.0
Former Team Member
Posts: 4449
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Add location in mobile view?

Post by Christian 2.0 » 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 :)

Willoughby_wx
Registered User
Posts: 100
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Re: Add location in mobile view?

Post by Willoughby_wx » Sun Dec 10, 2017 11:19 am

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: 100
Joined: Thu Jul 12, 2007 11:21 pm
Location: In another world
Contact:

Re: Add location in mobile view?

Post by Willoughby_wx » Sun Dec 10, 2017 11:35 am

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
Christian 2.0
Former Team Member
Posts: 4449
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Add location in mobile view?

Post by Christian 2.0 » Sun Dec 10, 2017 11:55 am

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”

Who is online

Users browsing this forum: No registered users and 8 guests