GetSimple Support Forum

Full Version: interaction: default template -> sidebar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I want to display a php generated table on several pages. It should detect via a custom field (or slag?) on which page it is executed. As I understand I should do this by using a component and include it with dynpages plugin.
Alternatively I could pass an argument to the component.

Now comes the tricky (for me) part:
the rows in the table consist of textfields and some buttons. By pressing a button some content of the relevant row has to be processed (preferably php) to produce text or a link, which shall be displayed in the sidebar.
Do I have to use Ajax or JavaScript for that and is this even possible?

Any thoughts on this are appreciated.
I am a GS newbie, but I'm ok with php.

cheers
pinguin
If you're a bit familiar with php, I recommend to take a look at ItemManager. ItemManager is well suited for this as is.

(2016-09-06, 19:10:13)pinguin Wrote: [ -> ]Now comes the tricky (for me) part:
the rows in the table consist of textfields and some buttons. By pressing a button some content of the relevant row has to be processed (preferably php) to produce text or a link, which shall be displayed in the sidebar.
Do I have to use Ajax or JavaScript for that and is this even possible?


To do that, you can you can use ajax to execute a simple plugin, for example
Since sidebar is part of your template i would do this in your theme not in page content.

You can still use components by including it in your template.
get_component('id')
(2016-09-06, 23:51:12)shawn_a Wrote: [ -> ]Since sidebar is part of your template i would do this in your theme not in page content.

You can still use components by including it in your template.
get_component('id')

Thx for the hint, but how to prevent then my table to appear on every page?
If I understood correctly, you suggest to call the 'table component' within my default template?

BTW: I was trying to find any ajax implementation in GS, but the searchterm 'ajax' is too short.

thx for all the help!
you can use a special template and change those pages to it.
or something like:
Code:
<?php if (return_page_slug() == 'your-page') get_component('your-component'); ?>