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
And when viewing in user's profile
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
avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

Back to top Go down

Solved Re: Question about RPG feature

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

Bump Very Happy


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

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


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

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?
avatar
skouliki
Manager
Manager

Female Posts : 4475
Reputation : 740
Language : English,Greek
Location : Greece

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


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

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


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

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;
avatar
skouliki
Manager
Manager

Female Posts : 4475
Reputation : 740
Language : English,Greek
Location : Greece

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


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

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
avatar
skouliki
Manager
Manager

Female Posts : 4475
Reputation : 740
Language : English,Greek
Location : Greece

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.


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

avatar
SLGray
Administrator
Administrator

Male Posts : 44187
Reputation : 3141
Language : English
Location : United States

http://fmthemesdesignteam.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


avatar
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 927
Reputation : 156
Language : English

http://rotavn.forumotion.com

Back to top Go down

Back to top


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