We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42101
    • 125 Posts
    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.]
      • 4172
      • 5,888 Posts
      can't you use a complete different page for the detail-view?

      <a href="[[~yourDetailViewID? &migx_id=`[[+MIGX_id]]`]]">view details</a>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 42101
        • 125 Posts
        Hey Bruno,

        thanks for your reply. I have created a new "resourc" - called "detail" and hiding it from the menu.

        I tried this inside this resource "details" ID = 6:
        [[!getImageList? &tvname=`MyJobs` &tpl=`detailTpl` &where=`{"MIGX_id":"[[+migx_id]]"}` ]]



        this is the link

        <a href="[[~8? &migx_id=`[[+MIGX_id]]`]]">view details</a>


        But nothing shows up.

        Thank you!

        AD [ed. note: ad2003 last edited this post 13 years, 3 months ago.]
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The link should look something like this:
          <a href="[[~6? &migx_id=`[[+MIGX_id]]`]]">view details</a>

          http://rtfm.modx.com/display/revolution20/Resources#Resources-URLParametersforResourceTags
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 4172
            • 5,888 Posts
            you can replace the placeholder
            [[+migx_id]]
            for example with the getReqParam - snippet
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 42101
              • 125 Posts
              Quote from: sottwell at Jun 21, 2013, 10:59 AM
              The link should look something like this:
              <a href="[[~6? &migx_id=`[[+MIGX_id]]`]]">view details</a>

              http://rtfm.modx.com/display/revolution20/Resources#Resources-URLParametersforResourceTags

              thanks - I misspelled it here, but I used it like the above. smiley
                • 42101
                • 125 Posts
                Quote from: Bruno17 at Jun 21, 2013, 11:01 AM
                you can replace the placeholder
                [[+migx_id]]
                for example with the getReqParam - snippet

                Ok, is there something on the web to learn a bit more about "getReqParam" snippet?

                I found this: https://gist.github.com/zaigham/813512 and created a snippet called "getReqParam" - but I don't know what to do next. :-( * * * *


                Thanks!

                AD
                  • 4172
                  • 5,888 Posts
                  http://modx.com/extras/package/getreqparam

                  [[!getImageList? &tvname=`MyJobs` &tpl=`detailTpl` &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}` ]]

                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 42101
                    • 125 Posts
                    Hi Bruno,

                    thank you very much for your help.

                    I installed getReqParam with PacketManager,

                    I created a resource callded
                    details 
                    including
                    [[!getImageList? &tvname=`MyJobs` &tpl=`detailTpl` &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`]]
                    .

                    Doesn't work at the moment.

                    the chunkt which generates the detail view links look like this as 5 is the ID of resource
                    details
                    :

                    <a href="[[~5? &migx_id=`[[+MIGX_id]]`]]">view details</a>


                    Thank you very much! AD


                      • 4172
                      • 5,888 Posts
                      sorry, I forgot to add the docid - Property, which you need, if you want to get the values of a MIGX-TV from another resource.

                      [[!getImageList? 
                          &tvname=`MyJobs`
                          &docid=`XXX` 
                          &tpl=`detailTpl` 
                          &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
                      ]]


                      replace XXX with the resource-id where you have the MIGX-TV
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!