eZ Community » Forums » Developer » Remove or edit parameters from...
expandshrink

Remove or edit parameters from attribute_view_gui

Remove or edit parameters from attribute_view_gui

Monday 11 August 2014 11:16:49 pm - 16 replies

Hello, I have this in one of my templates:
{attribute_view_gui attribute=$producto.data_map.image $my_val=attribute  image_class="categoriaProducto"}
                        <div class="prodText">{$producto.data_map.frase.content}</div>
On my page this produces:
<div class="prodText" style="bottom: -50px;"> MY TEXT </div>

I just want to remove the style="bottom: -50px" or set it to 0.
This is not a parameter in my css, so I can't edit.
Any solution for this?
Greatings

Sunday 17 August 2014 12:28:17 pm

Hello Pavel,

Sounds like it would help if you enabled debug output and got the path to the template in question so you can edit it or make a template override.

Alternatively you could grep the source code for the template which uses text 'prodText' and edit the template.

I hope this helps!

Cheers,
Heath

Sunday 17 August 2014 9:05:43 pm

OK I'll try this and will comment after

Thanks

Wednesday 20 August 2014 8:53:16 pm

Anyway I can't find the templte but how do I retrive or modify a variable inside a object like this?
Thanks and greatings

Thursday 21 August 2014 9:24:15 am

Hello Pavel,

You can not modify styles within an object by default. This is because styles are only stored within stylesheets (css files) by default.

You will need to explain what you tried and what did not work in much greater detail. Please be verbose and show examples.

Also worth telling you here is that eZ Publish by default does not use inline styles. eZ Publish uses stylesheets by default. So what you have here is a custom template override which contains an inline style. This can not be overriden since inline styles override stylesheets within a browser.

You must enable debug output and find out what template is being used, edit the template and remove the inline style definition.

To enable DebugOutput you must add the following settings to your settings/override/site.ini.append.php file

[DebugSettings]
DebugOutput=enabled
 
[TemplateSettings]
ShowUsedTemplates=enabled

Then clear all caches and reload the page in question within your web browser. This will display a list at the bottom of the page of all the templates used to render the page.

Then it will be a matter of inspecting the list of templates and reviewing each one until you find the template that has the inline style. Once you find the template in question all you have to do is remove the inline style, save the file, clear all caches and reload the page in the web browser.

I hope this helps ...

Cheers,
Heath 

Modified on Thursday 21 August 2014 9:25:59 am by // Heath

Thursday 21 August 2014 9:43:04 am

Hello,

Actually it sounds more like Pavel thinks he knows what template is being used already based on the fact he posted an example with eZ Template source code.

The problem is browsers don't add inline styles which means he must be looking at the -wrong- template. He should find the template which contains the inline style code.

But it doesn't sounds like he can or will. Too bad, that will hurt him long term. He really should find that darn code and get ride of it directly. But ...

Fortunately there is another way. Simply add this to your main stylesheet (if you don't know what your doing add it to the bottom of the css file). Check the references section of this post for more information on where I got this answer from.

.prodText
{
    bottom: 0px !important;
}

This css above will override your inline style. Not the best solution but it should work if you use it correctly. Note: This code is an untested example but should point you in the right direction.

Good Luck! Angry? No, listen to the THEME, I'm Happy ... 

Cheers,
//kracker

THEME: https://soundcloud.com/sole-dj-pain-1/im-happy

References

Thursday 21 August 2014 9:59:46 am

Hello Pavel,

You should be able to find the template in question by running a command similar to this one:

cd /path/to/ezpublish;
 
grep -R "prodText" .;

This will search all of ezpublish source code recursively for files which contain the css class 'prodText'.

You will have to review all the files which are returned by this grep command to find the template file which contains the inline styles causing you such trouble.

Don't listen to them man: you can find this template and fix the problem.

Best wishes

Modified on Thursday 21 August 2014 10:02:21 am by wtf

Thursday 21 August 2014 2:02:38 pm

Hello,

I think Pavel is done with the inline style problem (or given up on it for now).

His most recent post seems to be asking how to change a variable in the template language.

@Pavel  -  What variable do you want to change and why? Can you share a more specific example?

In a more generic answer, you can edit content object data from within the eZ Publish Admin.

Cheers,
James

Saturday 23 August 2014 1:30:30 am

Ok, thank you guys for the replays.
So like @// kracker said I actaully know witch is the template so I put the code I found there.
The @wtf said to make add .product I think wont work because the property will be overwritten.
As @James James asks I'll put an example:
http://s12.postimg.org/mmjzflo8t/image1.png Hre I show how the firedebug looks when I don't have the mover over.
http://s12.postimg.org/3sy6ilq0t/image2.png In the second image I show how the image looks when I have the mover over the image.
So I want by default to look like in the second image.
Thanks

Saturday 23 August 2014 11:38:50 am

Hello Pavel,

Based on what you have just said and the screenshots you shared, I think you might have javascript code which is adding the inline styles and causing the problem.

Please, Test this idea by disabling javascript in the web browser by either using the 'NoScript' or 'WebDeveloper' extensions to Firefox web browser. 

Disable javascript and load the page. You should notice the inline styles are not added to the html.

Once you confirm that with javascript disabled the inline styles are not manipulated / added / removed then you must audit your website's javascript code to find the javascript code which is adding the inline styles and remove them or disable them.

I hope this helps ...

Cheers,
Heath

 

References:

Modified on Saturday 23 August 2014 11:43:13 am by // Heath

Saturday 23 August 2014 11:59:20 am

Hello,

You should also change the class name of the html in question. This will break the javascript (prolly jquery) which is changing the inline styles and stop the adding of the inline styles!

Code with prodText class currently:

<div class="prodText"> MY TEXT </div>

Code with different css class name:

<div class="prodDescriptionText"> MY TEXT </div>

This would solve the problem without requiring you to audit your site's javascript which can at times be very difficult and time consuming.

In any case this is -not- an eZ Publish problem in any way. I'm just sayin' ...

Good Luck!

Cheers,
//kracker

THEME: https://soundcloud.com/swagtoof/linger-feat-sole-prod-tofuo

Modified on Saturday 23 August 2014 12:04:28 pm by // kracker

Saturday 23 August 2014 1:14:42 pm

OK @ // Heath you are right is't a javascript file.
@// kracker Changing the name will be ok , but there are other things the javascript file needs to do, so this doesn't work. Thanks anyway

Saturday 23 August 2014 2:16:31 pm

Hello Pavel,
I only recommend changing the div css class name temporarily to prove that javascript is using it to add the inline styles.

Obviously this change does not need to be made permanently.

Best Wishes!

Cheers,
//kracker

THEME: https://soundcloud.com/soleonedotorg/the-trap-w-mestizo

Saturday 23 August 2014 2:38:07 pm

Hello Pavel,

I'm glad you narrowed the problem down to a javascript problem which is adding the inline styles! Congratulations!

Just to be clear I only advocated disabling javascript temporarily to prove it was javascript adding the inline styles. Obviously this is not a permanent solution.

If you were to post your javascript code as a github gist I might be able to help review it and find the javascript code which is adding the inline sties and help you disable them.

If you have already solved your javascript problem please remember to mark your original post as solved by clicking the checkbox image at the top of the title of this thread. Thank you.

Cheers,
Heath 

Sunday 24 August 2014 1:10:13 am

Quote from // kracker :

Hello Pavel,
I only recommend changing the div css class name temporarily to prove that javascript is using it to add the inline styles.

Obviously this change does not need to be made permanently.

Best Wishes!

Cheers,
//kracker

THEME: https://soundcloud.com/soleonedotorg/the-trap-w-mestizo

OK, thanks a lot that helped me
BTW nice song this one: https://soundcloud.com/sole-dj-pain-1/im-happy
Greetings

Modified on Sunday 24 August 2014 1:12:23 am by Pavel Miron

Sunday 24 August 2014 1:11:59 am

Quote from // Heath :

Hello Pavel,

I'm glad you narrowed the problem down to a javascript problem which is adding the inline styles! Congratulations!

Just to be clear I only advocated disabling javascript temporarily to prove it was javascript adding the inline styles. Obviously this is not a permanent solution.

If you were to post your javascript code as a github gist I might be able to help review it and find the javascript code which is adding the inline sties and help you disable them.

If you have already solved your javascript problem please remember to mark your original post as solved by clicking the checkbox image at the top of the title of this thread. Thank you.

Cheers,
Heath 

Finally this works like charm
Thanks a lot!!
I found everything in the javascript file
Greetings

Sunday 24 August 2014 7:38:25 am

Hello Pavel,

Congratulations! "I'm so happy" you were able to finally solve this problem happy.gif Emoticon

Thank you for marking this thread as solved! If you ever need help again we will all be here ready to help ...

Cheers,
Heath

Modified on Sunday 24 August 2014 7:40:15 am by // Heath

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from