Skip to content
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 i show same shortcode value in different place #511

Closed
xperter opened this issue May 2, 2015 · 7 comments
Closed

How i show same shortcode value in different place #511

xperter opened this issue May 2, 2015 · 7 comments

Comments

@xperter
Copy link

xperter commented May 2, 2015

Hi
I have a shortcode and i like to print same saved value in another place.
Like i have shortcode name xyz and i need get the save value (not options) which saved in db.

I have tried with fw_get_db_ext_settings_option() but nothing found any value in shortcodes

Is it possible to print another place ??

Thanks for your help

@ghost
Copy link

ghost commented May 2, 2015

Hello,
It's not possible.


Similar issue #497


Imagine you have

[section][row][col][xyz/][xyz/][xyz/][/col][col][xyz/][button/][/col][/row][/section]
[section][row][col][xyz/][divider/][xyz/][/col][col][button/][/col][/row][/section]
[section][row][col][button/][divider/][button/][/col][col][xyz/][/col][/row][/section]

How will you get the value of a specific xyz shortcode? If there was a function to access shortcodes db values, how will you specify in function parameters which shortcode you want to access?

@ghost ghost self-assigned this May 2, 2015
@xperter
Copy link
Author

xperter commented May 2, 2015

Hi @moldcraft

Maybe i cant tell you clearly :( let me clear.
we have create a shortcode called xyz
and view.php we can print all the option details with fw_print('$atts')

I wanna print xyz $atts another place so we can get the same result which saved in xyz shortcode.
and if i change anything in xyz shortcode from page there will be same result.

i just need to enter xyz shortcode $atts so i can use this anywhere
I thing you clear now :)

Thanks for your help

@ghost
Copy link

ghost commented May 2, 2015

Sorry, I don't understand.
Please try to explain again (with more concrete details) or maybe someone who is reading this, understood you and can describe your question better.
Thanks

@pnpetroff
Copy link

@xperter Please check the solution here #275 (comment)

I think @moldcraft explained it very good. If you have more than one instance there is no way that your external function will know from which shortcode to get the options.

@xperter
Copy link
Author

xperter commented May 3, 2015

@pe6o Unyson team doing great job.
i dont see anywhere like them. specially moldcraft and valeriuzdrobau brothers are great :)

Thanks brothers

@pnpetroff
Copy link

Alright, I am making a Portfolio Grid shortcode with an AJAX "Load More" button. The problem is that when the button is pressed I can't work with the options field of the shortcode.

I am sending some variables with JS and data attributes but there are some complex ones like arrays but there is no way that I can reach the $atts variable of the shortcode...

Or is there?

@ghost
Copy link

ghost commented May 18, 2016

I am sending some variables with JS and data attributes but there are some complex ones like arrays

<div data-atts="<?php echo fw_htmlspecialchars(json_encode($atts)); ?>"></div>

then using those in javascript isn't a solution?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants