• Resolved mlapl1

    (@mlapl1)


    Hello
    I have just instaled the premium plugin and am discovering how things work (and I like everything I see). The following is not really a plugin question (a MySQL question) but you may be able to help anyway (I am sure you will know the answer immediately and it would take me forever to solve it).

    I would like to store some html (and some javascript) in a column and then execute the html/JS when the row is displayed. At the moment I have used a varchar column and also a blob column but that only shows the raw html/js. I know there is some way to do this but have no idea how to do it (maybe column type but …) .

    Thanks for any help.
    Andrew

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Andrew,

    Good to see you back! ??

    If I understand your question correctly you want to write JS code to your database table and execute it when the table is shown. This is generally not possible as WordPress does not allow to write unescaped content to a browser. Which is a wise dicision! ?? You can write JS code to you table column but that code will be shown as plain text when you display your table.

    Fortunately there is a problem for every solution! ?? You can add a dynamic hyperlink to your table to achieve this result. This is documented here:
    https://wpdataaccess.com/docs/documentation/data-explorer/dynamic-hyperlinks/

    Please check the examples. There is also a JS example.

    You can still save your JS content in your database table and add it to your dynamic hyperlink as $$JS_COLUMN$$. You just need to hide your the original JS column in output and display the dynamic hyperlink instead.

    Hope this helps! Let me know if you need further assistance.

    Good luck,
    Peter

    Thread Starter mlapl1

    (@mlapl1)

    Hello Peter
    Actually about 10 minutes before you answered I stumbled on the dynamic hyperlinks as a possible solution. Thanks for confirming it. I will look at the examples. Actually, I am trying to play a small component of a large audio/video file, so that I can dynamically set starting and ending points instead of making lots of clips. I have finally managed to figure out how to do this in JS so as to stay within the simplicity of (I think) of HTML5. It just requires a few lines of JS. Alternatively, I could send the start-stop parameters to an external file (probably a better more elegant solution but then I have to protect it too – which is ok but protecting the audio/video seems more difficult – maybe .htaccess). As you can see I am not very experienced but I think that there are solutions for this and your plugin is just so versatile.

    Thank you!!! Thank you!!!
    Andrew

    Thread Starter mlapl1

    (@mlapl1)

    Hello again and please forgive my laziness.

    Is it possible to access the contents of any column by surrounding it with $$ signs as in $$JS_COLUMN$$ (which you give as an example)?

    If so, then I presume one can construct a URL dynamically…

    Thanks and sorry for asking so many questions
    Andrew

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Andrew,

    >>> Is it possible to access the contents of any column by surrounding it with $$ signs as in $$JS_COLUMN$$ (which you give as an example)?

    Yes! As long as the column is in the table to which you add the dynamic hyperlink. You cannot add a column from another table.

    Hope this helps.

    Good luck! ??
    Peter

    Thread Starter mlapl1

    (@mlapl1)

    Thank you for both responses Peter. I will look.
    I understand the point about the responsive mode but the current structure creates a very large space just for a number (actually the index for my rows). I only need it to be a few numbers wide.

    Instead I get a very wide blank space.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Andrew,

    Maybe you can check your theme CSS? CSS from other source can affect the layout of a publication.

    Best regards,
    Peter

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘HTML question’ is closed to new replies.