Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
interaction: default template -> sidebar
#1
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
Reply
#2
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
Reply
#3
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')
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#4
(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!
Reply
#5
you can use a special template and change those pages to it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#6
or something like:
Code:
<?php if (return_page_slug() == 'your-page') get_component('your-component'); ?>
Reply




Users browsing this thread: 1 Guest(s)