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 Bruno - thank you very much for your great help on understanding migx, a bit more every time. I used your code and it's working now. I am very sorry to ask so many questions about using migx for the stuff I want to do, but I find it very hard to find documentations or easy example tutorials to learn to use it more independently.

    So I have one more question about it.

    When I have the detail view for one Job - e.g. "Tellerwäscher" - I'd like to also have this in the header of the page - like "Jobs: Tellerwäscher" - "Sitename".

    I was thinking of creating a
    $Detail_Head
    and in the "titel=" I put the "[*title]" from the migx item. But of course - the title doesn't show up, hence modx doesn't "reads" it.

    Is it a good way of using something like "if this is migx item "MyJobs" do this" in the normal header? What would be the most useful way for this? Is it better to use one Template and use conditional stuff, or is it better to use different Templates?


    I am using this code now in a DetailView Template:

    <title>[[!getImageList? 
        &tvname=`MyJobs`
        &docid=`4` 
        &tpl=`detailHeadTitle` 
        &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
    ]] - [[++site_name]]</title>


    where
    dtailHeadTitle 
    ocnstist of "[[+title]]. This works now. Is it a good way or could it be better?



    Sorry again for tons of questions and thank you very much again for your great help!

    AD



    [ed. note: ad2003 last edited this post 13 years, 3 months ago.]
      • 4172
      • 5,888 Posts
      <title>[[!getImageList?
          &tvname=`MyJobs`
          &docid=`4`
          &tpl=`detailHeadTitle`
          &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
      ]] - [[++site_name]]</title>
      


      this looks good.

      You can also use inline-tpl:
      <title>[[!getImageList?
          &tvname=`MyJobs`
          &docid=`4`
          &tpl=`@CODE:[[+title]]`
          &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
      ]] - [[++site_name]]</title>


      and you could do the filtering for both outputs one time and store the result into a placeholder in json-format, readable for other getImageList-calls:

      this at top of the template:
      [[!getImageList?
          &tvname=`MyJobs`
          &docid=`4`
          &toJsonPlaceholder=`jobDetails`
          &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
      ]]


      and get it this way:

      <title>[[!getImageList?
          &value=`[[+jobDetails]]`
          &tpl=`@CODE:[[+title]]`
      ]] - [[++site_name]]</title>
      


      the same for the second call, just with another tpl.
      Does this work?










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

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 42101
        • 125 Posts
        Hi Bruno,

        yes, great! This works. really interesting this placeholder stuff - it's the first time I think I slowly understand it smiley.

        Now it works. Thanks for that!!

        Sorry - but another question:
        To get images, I am using this code here in the listing of one Migx Call:


                     
        <img src="[[+image]]" />


        This works great - I am getting the images listed. But what if I'd like to use phpThumbOf?

        I tried this

        <img src="[[!phpthumbof? &input=`[[+image]]` &options=`&w=125`]]" />


        This gives me all the same images.

        I am guessing there should be something more inside the [[+image]] chunk?

        I also tried the Placeholder like this:

        at top of the Tpl:
        [[!getImageList?
            &tvname=`MyGallery`
            &docid=`4`
            &toJsonPlaceholder=`myImages`
            &where=`{"MIGX_id":"[[!getReqParam? &name=`migx_id`]]"}`
        ]]


        and

        <img src="[[!getImageList?
            &value=`[[+myImages]]`
            &tpl=`@CODE:[[+image]]`
        ]]" /> 


        but this didn't work out.

        Thank you very much!

        AD



          • 42101
          • 125 Posts
          Hi again - sorry to ask again - but what could I do to get the "phpThumbof" getting to work right? It's all working so far, but I can't get phpThumbof to get working for each individual migx Item.

          Thank you!

          AD
            • 4172
            • 5,888 Posts
            do you get the correct path to your image with

            [[+image]]
            in your tpl-chunk?

            then you can do
            <img src="[[+image:phpthumbof=`w=125`]]" />
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 42101
              • 125 Posts
              Hi Bruno, thank you for the reply. When I use this code inside the tpl-chunk:
              <img src="[[+image:phpthumbof=`w=125`]]" />



              That was, what I was trying - but I am getting all the same images for all migx items on page "gallery". So the first image thumbnail shows up for every migx item - but every migx item has another image....


              thanks.



              AD

              edit: here is a screenshot from the gallery with phpthumbof link:



              here only [[+image]] but without phpthumbof:

              [ed. note: ad2003 last edited this post 13 years, 3 months ago.]
                • 42101
                • 125 Posts
                ok! Now I see the problem. I was using a link to an external file - that's why it wasn't working. Now I uploaded a file and it works.
                Sorry for the trouble. Now it works like it should! External File handling would also not be bad to know, but this works now.

                thx
                AD