Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use of Components
#1
Hi

I have a couple of questions..

Is it ok to call components <?php get_component('test'); ?> within the page content instead of template code? I have tested it and it works but is there anything I should know of.

I need to add unique component to every page. Is there any disadvantages in creating many components? Lets say 100+ pages with 100+ unique components?

Thanks in advance.
Reply
#2
you would need the php-exec plugin to add php into the body of a page, but if you are doing that, then why create a component for this? Why not just put what would be in the component directly into the page?
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
I already installed php-exec which works fine but when I put my code, it just shows a blank page. This particular code also includes javascript within the php codes.
But when I put them in component it works!

I like the php-exec plugin which I also use in wordpress but here it doesn't work.

Thanks
Reply
#4
mosa Wrote:I already installed php-exec which works fine but when I put my code, it just shows a blank page. This particular code also includes javascript within the php codes.
But when I put them in component it works!

I like the php-exec plugin which I also use in wordpress but here it doesn't work.

Thanks

Put the code into a component and use the DynPages plugin to include it in a page. You can also parametrize the component this way, see also here.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#5
So I understand using DynPages I can include component {% component1 %} in a page.

Is there any limit how many component can be created? I will need a unique component for each page and that could be hundred over the time.
Reply
#6
mosa Wrote:So I understand using DynPages I can include component {% component1 %} in a page.

Is there any limit how many component can be created? I will need a unique component for each page and that could be hundred over the time.

Why do you need a unique component for each page? What are you trying to accomplish? Can you give us examples?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#7
Ok, say I have to create a page for red apples, after description there will be a price table from different retailers.
So this red apples page should show red color apples in default and the table has options to narrow it down by size, weight etc.
Now if I have to create green apples page and show green color apples in default result then I have to mention that in the code. And the list goes on.
Reply
#8
mosa Wrote:Ok, say I have to create a page for red apples, after description there will be a price table from different retailers.
So this red apples page should show red color apples in default and the table has options to narrow it down by size, weight etc.
Now if I have to create green apples page and show green color apples in default result then I have to mention that in the code. And the list goes on.

This rather sounds like you need one component parametrized by product type or code, which then retrieves the price information from the retailers or a database.

Alternatively - if the information does not change often - you could put the table with the prices, sizes, etc. on the page itself and then use some jQuery magic to filter the table and hide non-matching rows.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#9
Thanks, doing that is out of my comfort zone. I kind of thought it will work as I have php-exec and completed some design work.
I like this cms as it is very easy to maintain and lightweight but there you go.
Reply
#10
mosa Wrote:Thanks, doing that is out of my comfort zone. I kind of thought it will work as I have php-exec and completed some design work.
I like this cms as it is very easy to maintain and lightweight but there you go.

So you are no programmer ;-)

Regarding the number of components it will probably work just find with 100 components, but I would never manually create that many, but instead write one component getting the data from somewhere based on the product (code or id). I'm a programmer and thus f**king lazy.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#11
php-exec works if I remove the line below but then javascript side fails. Although the whole code works in wordpress with php-exec plugin.

Code:
echo  "<script type=\"text/JavaScript\">\n <!--\n var defaultOptions=\"$defaultOptions\";\n //-->\n </script>\n";
Reply




Users browsing this thread: 1 Guest(s)