Question about RPG feature

Go down

Solved Question about RPG feature

Post by SarkZKalie on July 10th 2018, 2:24 pm

Technical Details


Forum version : #PunBB
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
Forum link : http://rotavn.forumotion.com/forum

Description of problem

Hello guys

I'm building a RPG feature for my site and first of thing here are my settings in ACP -> Modules -> RPG -> Fields Management
PunBB - Question about RPG feature OqN16DC
And when viewing in user's profile
PunBB - Question about RPG feature UU8p5hE
How to display an only field named "Character" what contains an <img> inside it?
For example they are 2 fields with a same name "Character"
With an image inside <dl>
Code:
<dl class="rpg_fields"><dt>&nbsp;<span class="gen">Character</span> :</dt><dd class="rpg_fields-l"><span class="gen"><span class="gen">Prophetess ★★</span><img src="https://i.imgur.com/PPPIJEv.png" alt="Prophetess ★★" style="vertical-align: top;"> </span></dd></dl>
And without any image
Code:
<dl class="rpg_fields"><dt>&nbsp;<span class="gen">Character</span> :</dt><dd class="rpg_fields-l"><span class="gen"><span class="gen"></span></span></dd></dl>

Thanks


Last edited by SarkZKalie on August 7th 2018, 11:16 pm; edited 2 times in total
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on July 13th 2018, 6:22 am

Bump Very Happy


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on July 18th 2018, 8:19 am

Have a nice days everyone Very Happy


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by skouliki on July 18th 2018, 8:43 am

hi

you want the name Character to one field to not displaying at all?
skouliki
skouliki
Manager
Manager

Female Posts : 9027
Reputation : 1177
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on July 18th 2018, 3:45 pm

For more detail, there are 4~6 Character field and I only want the one already have an IMG tag inside be allow to show PunBB - Question about RPG feature 1f601
This one should
Code:
<dl class="rpg_fields">
<dt><span>Character</span> :</dt>
<dd class="rpg_fields-l"><span><span><img src="IMAGE LINK" /></span></span></dd>
</dl>
This one shouldn't
Code:
<dl class="rpg_fields">
<dt><span>Character</span> :</dt>
<dd class="rpg_fields-l"><span><span>NOTHING HERE</span></span></dd>
</dl>


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on July 20th 2018, 3:00 pm

Hello it's bump again Very Happy


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by skouliki on July 20th 2018, 5:00 pm

did you try to put to the field name instead of character this
&nbsp;
skouliki
skouliki
Manager
Manager

Female Posts : 9027
Reputation : 1177
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on July 21st 2018, 4:27 am

It's good but how could you choose a field if it was invisible


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Solved Re: Question about RPG feature

Post by skouliki on July 21st 2018, 2:09 pm

i dont know any other solution sorry Sad
skouliki
skouliki
Manager
Manager

Female Posts : 9027
Reputation : 1177
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Question about RPG feature

Post by SLGray on July 21st 2018, 10:47 pm

There should be a edit icon appear when you hover your cursor over the field.


PunBB - Question about RPG feature Slgray10
PunBB - Question about RPG feature Ssshfm13

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 47933
Reputation : 3365
Language : English
Location : United States

View user profile https://help.forumotion.com/

Back to top Go down

Solved Re: Question about RPG feature

Post by SarkZKalie on August 7th 2018, 11:16 pm

My problem can be solved by adding these scripts
With an jQuery library
Code:
<script type="text/javascript">
$('.rpg-dll').not(':has(img)').hide() // or remove() to take it out completely
<script>
Without jQuery
Code:
<script type="text/javascript">
        Array.from(document.querySelectorAll("dl.rpg-dll")).forEach(el => {
        let hasImage = el.querySelectorAll("img").length > 0;
        if (!hasImage) el.style.display = "none";
        });
    </script>
Special thanks to Luca and charlietfl

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


PunBB - Question about RPG feature Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1167
Reputation : 190
Language : English

View user profile https://www.rotavn.xyz/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum