Hi there,
I am trying to list two different migx lists in one page. MyItems, MyJobs. For both I have setup all the needed configurations to work right.
Both work fine, getting the items listed on the page.
Now I'd also like to have single view for "MyJobs" so when somebody wants to get more details, it opens up a new page with the job details.
I have setup the code like this (previous help from Bruno):
snippet:
switchMigxDetailView
//[[switchMigxDetailView? &detailChunk=`detailChunk` &listingChunk=`listingChunk`]]
$properties['migx_id'] = $modx->getOption('migx_id',$_GET,'');
if (!empty($properties['migx_id'])){
$output = $modx->getChunk($detailChunk,$properties);
}
else{
$output = $modx->getChunk($listingChunk);
}
return $output;
I am using this code to get the jobs listed:
[[!switchMigxDetailView? &detailChunk=`detailChunk` &listingChunk=`listingchunk`]]
this works perfectly.
listingchunk=
[[!getImageList?
&tvname=`MyJobs`
&tpl=`code_chunk` ]]
code_chunk=
<li class="span3 thumbnail ">
<a href="#" class="">
<img src="[[+image]]" /><p>[[+title]]</p>
</a> [[+description]]
<a href="[[~[[*id]]? &migx_id=`[[+MIGX_id]]`]]">view details</a>
</li>
I am using this for the detail view:
[[!getImageList? &tvname=`MyJobs` &tpl=`detailTpl` &where=`{"MIGX_id":"[[+migx_id]]"}` ]]
detailTpl is
<p>[[+title]]</p>
</a> [[+description]]
the other migx I am calling with this:
[[!getImageList? &tvname=`MyItem` &tpl=`listing`]]
Without detailview.
the whole page looks like this:
<div class="container">
<ul class="thumbnails">
[[!getImageList? &tvname=`MyItem` &tpl=`listing`]]
</ul
</div>
<hr class="soften" />
<div class="container">
<ul class="thumbnails">
[[!switchMigxDetailView? &detailChunk=`detailChunk` &listingChunk=`listingchunk`]]
</ul>
</div>
Ok, so this like I said, works all without a problem. But when I now click on the details view in MyJobs, I am getting a page with the single view of the migx items - but also with the other content myItems. Do I have to setup different Themes for this?
I thought about something to change here
<a href="[[~[[*id]]? &migx_id=`[[+MIGX_id]]`]]">view details</a>
Can I tell migx to use this link, but with another Template? What would be a intelligent solution? Maybe something conditional...
I'd like to have the "view Details" page like a page (header, nav, footer) with only the content of the job Details.
sorry for the long post. It's only a test/learning page at the moment, to get more used to migx.
Thank you!
AD
[ed. note: ad2003 last edited this post 13 years, 3 months ago.]