Undesirable space in {item->id} and the like

More
11 years 7 months ago #35505 by bendeb
Hello,

In field parameters of relation field (and certainly many others), in "item HTML" of "List Creation (Frontend Views)" we can add tags like this : {item->id}, etc.

With this tag, I can display the ID of my item.
But it displays a space before the ID.
And if I want to display this ID as a value of an html tag like this :
Code:
<div class="{item->id}"></div>
This give as a result :
Code:
<div class="[space]369"></div>

(Replace [space] by a normal space of course, and 369 is the ID of my item in this example)

So, my div class is not valid due to this space and I can't call it nor define it in any php or html file.

There is the same problem with {item->title} but not with __item_title_escaped__

Is it possible to remove this "prefix" space, by modifying the code somewhere ?

Thanks for your answer. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #35527 by ggppdk
Hello,
this will be displayed correctly by browsers and also javascript will work properly too

you mean that the HTML validators complain of invalid HTML syntax?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #35543 by bendeb
Hello,

It doesn't work for me.
In Item HTML parameters, I put :
Code:
<div class="{item->id}"></div>

And it gives this result in browser :
Code:
<div class=" 369"></div>

So when I try to style this class, it's not recognized by any browser. I tested it on Firefox and Chrome (the latest versions).
CSS selector can't have space, so I can't put this in my CSS file, it doesn't work :
Code:
. 369 {color:#d8d8d8;}

Thus, this undesired space is problematic, and it may be a solution to remove this, no ? :|

Thanks for your reply.

Flexicontent 4.1.0b1
Joomla 3.9.18

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #35549 by ggppdk
ok, with this example i see it clearly, your class name cannot start with number,

NOTE 1: this applies to 99% of various languages for variable names, function names , etc, etc
NOTE 2: the class TAG parameter can have mulitple classes

e.g. like this (notice the spaces):
Code:
<div class=" flexicontent fccategory fccat19 menuitem518 " id="flexicontent">

so use:
<div class="mycontent{item->id}"></div>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago - 11 years 7 months ago #35550 by bendeb
Yes, my example is wrong sorry.
Here is another example :
Code:
<div id="id{item->id}"></div>

This give :
Code:
<div id="id 369"></div>

And I can't style this id in css file.
Code:
#id 369 {color:#000;}
This doesn't work too.

I want to have :
Code:
<div id="id369"></div>

Thank you. :)

I found the file (I think) : /components/com_flexicontent/classes/flexicontent.fields.php

But I don't know what I have to replace to remove this space. Could you tell me please ?

Flexicontent 4.1.0b1
Joomla 3.9.18
Last edit: 11 years 7 months ago by bendeb.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #35551 by ggppdk
OK i now understand what you try to achieve,

Please find line (in the file you mention above about 1200-1400 line)
Code:
eval ("\$replacement_value = \" $replacement_value\";");
And remove the space after \"
so it will become:
Code:
eval ("\$replacement_value = \"$replacement_value\";");

I will commit fix , thanks for the report , your second example made it clear ;)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 1.081 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline