[SOLVED]CTLModuleMaker Module - How to specify the 'parent' template to be used?
[SOLVED]CTLModuleMaker Module - How to specify the 'parent' template to be used?
I have created a slick portfolio/catalog module using the wonderful CTLModuleMaker. I have created a Summary and Detail template for display of my output. The problem is, I'm using a lightbox-type plugin to display the Detail template when the user clicks the detaillink from the summary page. This works great, except when the lightbox is invoked, it automatically puts the output from my module into the overall site template by default, which 'blows up' my lightbox window. You can see what I mean by going here and clicking the (messy) URL. You'll see that the popup incorporates the ENTIRE template again, and I would like it to use another template I have which is built to support the size and content of the lightwindow.
http://gohalo.net/new/index.php?page=portolfio1
Is there a way to incorporate logic, or modify the generated module files to say "when user clicks the detaillink from the summary, dont use the site template that the summary page uses, instead use another"?
Thanks in advance!
http://gohalo.net/new/index.php?page=portolfio1
Is there a way to incorporate logic, or modify the generated module files to say "when user clicks the detaillink from the summary, dont use the site template that the summary page uses, instead use another"?
Thanks in advance!
Last edited by deejmer on Thu Oct 29, 2009 1:04 pm, edited 1 time in total.
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Sorry, this may sound stupid, but did you specify the detail template in your modules admin?
Or gave the detailtemplate="yourtemplate" as a parameter to the module call?
Right now I can't follow your link, because it produces an error.
Bernd
Or gave the detailtemplate="yourtemplate" as a parameter to the module call?
Right now I can't follow your link, because it produces an error.
Bernd
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
The error you're seeing is actually a link that is clickable (another bug I'm looking into); so it should work. And yes, I did specify the detail template and calling it from the tag, and it is actually working. The problem is, that Detail template that I have defined displays correctly, but appears within the context of the overall site template. I'm trying to have it ONLY display the contents of the detail template and eliminate the placement of it within the overall site template.
Its akin to clicking on a news item generated by the News module....its shows the news item detail in the defined template, but also displays within the 'master' site template where the news module is called.
Does this make sense?
Its akin to clicking on a news item generated by the News module....its shows the news item detail in the defined template, but also displays within the 'master' site template where the news module is called.
Does this make sense?
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
ahhh.. I see, and understand... I think.
Since your module-content needs at least a {content} tag, this is the only element you need. Doesn't it work with a stripped down template? Only doctype, body and {content}?
Since your module-content needs at least a {content} tag, this is the only element you need. Doesn't it work with a stripped down template? Only doctype, body and {content}?
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
First of all...thanks for trying to understand this mess.....its quite complex. Let me try clarifying some more:
If you visit that URL I provided you'll see a site template being applied; lets call it "MAIN_TEMPLATE"
So, I have a page with the template MAIN_TEMPLATE applied.
On that page, I have the tag to call the custom module i made in CTLModuleMaker, using the list-template defined in the module.
When I click the link to see the details, it automatically puts the content (using the detail template) into MAIN_TEMPLATE.
I already have another template called POPUP which has very stripped down markup (per your suggestion). Its made to display content appropriate for my lightbox popup. I need to somehow tell the module "don't use the MAIN_TEMPLATE that is being used for the list display, but instead use POPUP when displaying the details"
To test this, I created another page using POPUP as the template, again I have the tag to incorporate the custom module, using the list-template defined in the module. When I click the link to see the details, it automatically puts that content into POPUP template. It seems that whatever template you are using to call the custom module, the detail view will always use this same site template.
The issue is, I'm calling the module from a page using MAIN_TEMPLATE, but when I click the Detail link, I want it to actually use POPUP instead.
If you visit that URL I provided you'll see a site template being applied; lets call it "MAIN_TEMPLATE"
So, I have a page with the template MAIN_TEMPLATE applied.
On that page, I have the tag to call the custom module i made in CTLModuleMaker, using the list-template defined in the module.
When I click the link to see the details, it automatically puts the content (using the detail template) into MAIN_TEMPLATE.
I already have another template called POPUP which has very stripped down markup (per your suggestion). Its made to display content appropriate for my lightbox popup. I need to somehow tell the module "don't use the MAIN_TEMPLATE that is being used for the list display, but instead use POPUP when displaying the details"
To test this, I created another page using POPUP as the template, again I have the tag to incorporate the custom module, using the list-template defined in the module. When I click the link to see the details, it automatically puts that content into POPUP template. It seems that whatever template you are using to call the custom module, the detail view will always use this same site template.
The issue is, I'm calling the module from a page using MAIN_TEMPLATE, but when I click the Detail link, I want it to actually use POPUP instead.
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
mhh... it is, in fact, very complex.
But what if you define your template:POPUP for the detailview as standard(in the settings), and then tell any modulecall what template to use, EXCEPT for the lightbox link.
Then no matter what, the module "has" to use what is defined in the settings. The POPUP template.
Or not?
I have made so many modules with CTLMM but it is quite difficult to think yourself into someone else's project.
But what if you define your template:POPUP for the detailview as standard(in the settings), and then tell any modulecall what template to use, EXCEPT for the lightbox link.
Then no matter what, the module "has" to use what is defined in the settings. The POPUP template.
Or not?
I have made so many modules with CTLMM but it is quite difficult to think yourself into someone else's project.
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Sorry, but I think there is still a distinction that isn't understood...and you're right, its very hard to think your way into someone else's project and I truly appreciate you trying 
the module templates (list and detail) defined in the custom module generated by CTL are working great...displays just as I would expect.
Let me try to illustrate this:
1: In admin panel: CMSMS Page named "portfolio1" - has MAIN_TEMPLATE applied (which is a site template; not a module template)
2: In admin panel: "portfolio1" page 'content' contains only the module tag to call my custom CTL module - {cms_module module="portfolio" listtemplate="list_default"}
3: On front end: user sees the list view template output displayed inside of the site template MAIN_TEMPLATE; clicks element (this is fine, how I want it)
4: On front end: user sees a lightwindow launch, inside of the window is the detail view template output displayed inside of the site template MAIN_TEMPLATE
All is good here except item 4, specifically the portion in red. I want user to click the element, and the lightbox show the detail template BUT instead of showing in the site template MAIN_TEMPLATE; they either see my POPUP template (or even at this point NO parent template at all would be ok)
Have we beat this dead horse enough yet?! lol

the module templates (list and detail) defined in the custom module generated by CTL are working great...displays just as I would expect.
Let me try to illustrate this:
1: In admin panel: CMSMS Page named "portfolio1" - has MAIN_TEMPLATE applied (which is a site template; not a module template)
2: In admin panel: "portfolio1" page 'content' contains only the module tag to call my custom CTL module - {cms_module module="portfolio" listtemplate="list_default"}
3: On front end: user sees the list view template output displayed inside of the site template MAIN_TEMPLATE; clicks element (this is fine, how I want it)
4: On front end: user sees a lightwindow launch, inside of the window is the detail view template output displayed inside of the site template MAIN_TEMPLATE
All is good here except item 4, specifically the portion in red. I want user to click the element, and the lightbox show the detail template BUT instead of showing in the site template MAIN_TEMPLATE; they either see my POPUP template (or even at this point NO parent template at all would be ok)
Have we beat this dead horse enough yet?! lol
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
I didn't have time to read very carefully, but from the big lines I'd say:
Create a page with the near-empty template, and tell your module to display item details in this page using the "detailpage" paremeter.
Create a page with the near-empty template, and tell your module to display item details in this page using the "detailpage" paremeter.
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
sorry, I'm not sure i understand this solution.
To try to clarify once again, the output is mostly correct. I get the listtemplate and detailoutput as i'd expect.
the problem is, i dont want the detailoutput to have anythign OTHER than the module template defintion. I dont want it to appear in the SITE Template. If you click the link on this page (that looks liek an error) I think it will become more clear.
See attachments:
listview.jpg - in a screenshot, i highlighted the actual output of the listview template defined in the module in the transparent box w/border - This page display is fine (except an error being the URL of course...but another issue). I want the listview output to appear in the main site template.
detailview.jpg - i highlighted the actual output of the detailview template defined in the module in the transparent box w/border - This page display is NOT fine. I want the detailview output to appear ON ITS OWN and not to be incorporated into the main site template.
- are you saying I should create a SITE template or a MODULE template that is mostly blank?Create a page with a near-empty template
- right now I'm using this tag on the page i created: {cms_module module="portfolio" listtemplate="list_default"} I assume this is what you mean.tell your module to display item details in this page using the "detailpage" paremeter
To try to clarify once again, the output is mostly correct. I get the listtemplate and detailoutput as i'd expect.
the problem is, i dont want the detailoutput to have anythign OTHER than the module template defintion. I dont want it to appear in the SITE Template. If you click the link on this page (that looks liek an error) I think it will become more clear.
See attachments:
listview.jpg - in a screenshot, i highlighted the actual output of the listview template defined in the module in the transparent box w/border - This page display is fine (except an error being the URL of course...but another issue). I want the listview output to appear in the main site template.
detailview.jpg - i highlighted the actual output of the detailview template defined in the module in the transparent box w/border - This page display is NOT fine. I want the detailview output to appear ON ITS OWN and not to be incorporated into the main site template.
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Create a page/site template (we'll call it "nude"), and a page (say "popup") that's not visible in the menu. Give that page the "nude" template.
On your normal page, call the module using :
{cms_module module="portfolio" detailpage="popup"}
(you could also use the page id, which would be slightly faster to process)
On your normal page, call the module using :
{cms_module module="portfolio" detailpage="popup"}
(you could also use the page id, which would be slightly faster to process)
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
YEAH! plger, thanks so much! This was the correct approach. I didn't see in the documentation of CTL or the resulting module anywhere that you can indicate a "detailpage"...but that worked.
I know I'm probably not supposed to do this, but since I have your ear, do you know why I'm getting the error in my list template?
Error: Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/clients/client16/web18/web/new/lib/smarty/Smarty.class.php(1954) : eval()'d code on line 11
It must be the way I'm calling the 'imagethumb' element which is an image upload item in my generated custom module (see text in red). If i replace this with plain text, it parses correctly.
{if $itemcount > 0}
{foreach from=$itemlist item="item"}
detailurl}" title="{$item->title}">{$item->thumbimg}
{/foreach}
{/if}
I chose this because I thought it was the appropriate tag listed from my "Template variables" tab.
I know I'm probably not supposed to do this, but since I have your ear, do you know why I'm getting the error in my list template?
Error: Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/clients/client16/web18/web/new/lib/smarty/Smarty.class.php(1954) : eval()'d code on line 11
It must be the way I'm calling the 'imagethumb' element which is an image upload item in my generated custom module (see text in red). If i replace this with plain text, it parses correctly.
{if $itemcount > 0}
{foreach from=$itemlist item="item"}
detailurl}" title="{$item->title}">{$item->thumbimg}
{/foreach}
{/if}
I chose this because I thought it was the appropriate tag listed from my "Template variables" tab.
I'm guessing I'm using the wrong tag?Smarty variables for the detail template
* $leveltitle
* $previous_item (if loaded)
* $next_item (if loaded)
* $item->name
* $item->alias
* $item->thumbimg (file object)
* $item->portfolioimages (array of file objects)
* $item->title
* $item->url
* $item->overview
* $item->features
* $item->technologies
* $item->isdefault
* $item->date_modified
* $item->date_created
* $labels->...
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Hi.
Me again...
Since it it is a file object you have to call your thumbnail with $file->thumbimg, or if it is an array of images(undefinded amount of images) in a loop:
Me again...
Since it it is a file object you have to call your thumbnail with $file->thumbimg, or if it is an array of images(undefinded amount of images) in a loop:
Code: Select all
Example:
{foreach from=$item->thumbimg item="file"}
<img src="{$file->url}" />
{/foreach}
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Bernd is right ($item->thumbimg is a file object), though to be precise:
or
(maybe Image with a capital letter, I don't remember, but it's written in the template help anyway)
(The next release will allow automatic toString conversion, but this will remain the orthodox way of using file objects)
Code: Select all
$item->thumbimg->url
Code: Select all
$item->thumbimg->image
(The next release will allow automatic toString conversion, but this will remain the orthodox way of using file objects)
Re: CTLModuleMaker Module - How to specify the 'parent' template to be used?
Thank you BOTH! I have given you both an 'applaud' to increase your karma. This was incredibly helpful to me, and I think others who use the CTLModuleMaker will find this string helpful as well. Marking this one solved.
Regards!
Regards!