August 11, 2014 at 5:13 pm #302736
Hello, is there a way of setting image and video url’s in the media elements of enfold, dynamically.
I want to pull demonstration links to videos & images that have been made for prospects who identify them self with a code that is used to query a database and extract the links.
I don’t understand where the elements are stored and rendered and how to intercept them.
If all else is impossible can I use ‘save as’ of a page to get the source code and put the relevant part into a code block and just use search/replace… I imagine that has a few problems though.
August 11, 2014 at 7:49 pm #302821
- This topic was modified 7 months, 2 weeks ago by twdlewis.
It depends on what element you are adding the data to and how the whole thing should/would potentially work.
Its unfortunately the kind of question that is far to open ended for a concrete answer.
DevinAugust 12, 2014 at 4:01 am #302971August 12, 2014 at 4:45 pm #303301
It would need to be a custom built WordPress page template. I’ve done something like that for a client and its not overly difficult but it is beyond what we can do for you via support.
If you have a bit of php experience the WordPress codex can walk you through creating the new page template and then its a few hours of time to code it together (depending on what kind of video player is needed).August 12, 2014 at 6:45 pm #303376August 12, 2014 at 7:20 pm #303384
No it wouldn’t. The video element in the builder would need to be modified to run do_shortcode and ignore the incorrect url.August 13, 2014 at 4:45 am #303609August 13, 2014 at 4:54 am #303614
A page template would be: http://codex.wordpress.org/Page_Templates
It would be select-able from the page template dropdown and would output your element either before or after the visual editor content. So when I did that for a client I made a page template called video player and wrote some php to grab the data from the url, save it as variables and then added the variables into the video player on the page.
I *think* that would be the easiest here but it depends on what your overall layout would be and how much other content should be edited on the page.
To replace a ALB drag and drop element or add your own see: https://github.com/DevinVinson/enfold-child-docs
I have a function in the functions.php file that points to the child themes shortcode folder where I’ve replaced the default magazine element with a modified version. That way it shows the last updated data instead of the published date http://www.kriesi.at/documentation/enfold/tutorials-how-to-articles/
You could do the same thing but create a new element.August 13, 2014 at 5:16 am #303627
The topic ‘How set image and video dynamically using php’ is closed to new replies.