-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add specific id to builder sections ? #275
Comments
I do see that you are adding the section ID in the builder |
Any way we can get this to work ? |
No suggestion on this one? |
Hi @danyj We will check it on monday. @moldcraft is missing 3-4 days and i need to discuss with him. |
That is temporary unique backbone Model.cid. It is lost/auto-generated on page refresh, it is used to find/identify builder item object (for e.g. on sortable drag from one column to another) and it is used only in backend internally.
Sorry for asking that late: Why do you need that? |
I am adding all section custom css to head. Background, box model or any section css options. Thus I need the id for each section. |
To make it more clear. I am against anything like this http://prntscr.com/6cc57f and in inc/static.php and html is clean. Now the auto generated ID for section/column, helps me add css in head for that specific column/section only. |
I understood what you want to do. |
Sure , thank you. On top of my head I saw it somewhere where you are passing the $atts['atts'] if you could just pass this id's as weel to $atts['somekey'] it would be great. But you know what you are doing. Thank you for the help! |
Sorry, I haven't done it. I will do it soon (no more exact promises). |
Not a problem. I am busy finalizing all theme options and in week or so will move to page options so it is ok for now. |
How/Where do you generate the css? |
inside the view I am getting all section/row extra options and using my dochead class to send them to head |
this is basically all I need
|
How you send them to head inside view? The view is rendered after head when the post content is generated. |
:) you did not believe me before , I mentioned it many times, I used my class to do this. What my class does is just adding your css to the ['cssinhead'] array, and I implode that array in static.php all css is in its place. it was bit of a hassle but is well worth it and html is clean vs this any time. |
oh , and the static.php I use to print everything is not section/static.php it is theme_name/inc/static.php |
I found the solution very simple: <?php
$auto_id = 'auto-id-'. fw_unique_increment();
ThzDochead::getDocument()->addCssInHead('#'. $auto_id .' { ... }');
?>
<section id="<?php echo $auto_id ?>" ... or I am missing something? |
I was thinking about the same thing and had my own function ( nice to see you have one ) to do that but it does not sit well with me because user might want to add additional css specific to the id and he will never have it right. I know I can add the class for them to style it but if I have 5 sections in the builder this was desired output
since that is how they are saved in DB for that page is it hard to add the id inside the $attr array ? |
Shortcodes doesn't have ids, they are stored as non assoc array. Another solution would be:
If input value will be empty, it will be generated, if it was already generated. it will stay the same. |
ok will try that and by looks of it it might just do what I need. thank you! |
about the new issue if builder disabled , i seen it before , thought that is how you wanted since you did not make the short codes available outside the editor |
note that I am using the multi picker you last changed |
some details? what actually doesn't work? |
is not taking selected value , |
the bug is in this check ThemeFuse/Unyson-Shortcodes-Extension@add95cf#diff-0a666e20f4726c5eb987b41816b00f28R118 if removed the multies work I used this approach without value set but even with this it cant find the value |
this one to be precise |
Thanks for the investigation. I am already fixing it now. The problem is that it doesn't take in consideration |
Fixed multi-picker and other option types.
I wrote that without verifying/testing. The problem was actually here. |
Anything else needed to be fixed in this issue? (except this) |
i took an out bud , 2:30 here, will test first thing in the morning and report back |
This one is for you scratch the previous bug report on special heading , seems to work fine |
Thank you too, for investigations and feedback. |
This (Ctrl+R) will be possible in the next version of Unyson (and page-builder extension). |
Nice work. Question , will it work in theme admin when ajax save is on ? |
I don't see any connection with Theme Settings. |
I use builder inside theme options , also have section and columns |
It should work. |
ok , np , if i have trouble will let you know. thnx for the great work and support. |
I am trying to assign specific id attribute to sections. I tried to use required option for the id but it seems like is not effective on modals #274 .
Now if I print the builder json I do see that each section in the builder has it's own object.
But the $attr array is returning only the section options.
Is there any way for me to get that object index or anything very specific to each section so that I can generate id's from it inside
The text was updated successfully, but these errors were encountered: