Log in | Register | Lost password

Bottom
Publication Field of Type Publication Query
  • Posted: 25.09.2007, 14:24
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hello,
    I have created a Publication Type with various fields (Title, Image etc) which can all be successfully accessed in the underlying pagesetter *.html template. However, I have also created a field called 'Link1' which has the type 'Publication'. When configuring this type I have clicked the popup button next to the field type selector (..) to specify additional input parameters and have selected an existing Publication Type from the 'Extra type information for publication' window - say the selected Publication is called 'books'.

    I then create an instance of the Publictaion Type with values for Title, Image etc For the Link1 field of type Publication I select an existing instance within the Books template called Moby Dick.

    Within the underlying Pagesetter template I can successfully link to the Moby Dick instance of the 'books' template by using:

    Code

    href="index.php?module=Pagesetter&func=viewpub&tid=23&pid=<!--[$Link1.url]-->">


    Here

    Code

    $Link1.url
    refers to the ID number of the instance Moby Dick.

    I am wondering if it is possible to access the Title of the instance Moby Dick?

    Thanks

    Robbie
  • Posted: 25.09.2007, 14:51
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    try

    $Link.title
    $Link.name

    $link is an array and you have to specify which item you want from that array.
  • Posted: 25.09.2007, 15:03
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Thanks but I have tried both of these and they both give the same result as

    Code

    $link.url
    , i.e. an integer relating to the publication ID. Any other ideas?
  • Posted: 25.09.2007, 15:25
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Oh yeah, sorry...

    $link is just the number of the publication... you have to use a plugin to call the data from that plugin. I think when you create a template using pagesetter's create templates feature the plugin/code is inserted...

    I use a custom plugin to call the pubdata based on a pub id... I can post it later tonight when I get home form work...
  • Posted: 25.09.2007, 15:31
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Thanks - I'll look forward to viewing and using it.

    Regards

    Robbie
  • Posted: 25.09.2007, 15:36
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I was mistaken, while I do have some custom plugins they are specific to my site... the

    Code

    <!--[pnmodapifunc modname=pagesetter func=getPub tid=X pid=$Y assign=Z]-->


    Where X is the tid of the publication you wish to call, Y is the pid and Z is the var you'll assign the array to. So you could use $link for Y as that's the pid of the publication you assigned during creation. Then all of the data for the fields(X) in the publication(Y) is stuck into the array(Z). Then you'll use $Z.title or $Z.core.creator etc...
  • Posted: 25.09.2007, 16:23
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Thanks for that information. I have added the following code to the page as instructed but still am not getting the title etc.

    Code

    <!--[pnmodapifunc modname=pagesetter func=getPub tid=23 pid=$Link1 assign=Z]-->



    Display $Z.title: <!--[$Z.title]-->


    I have looked in the modules/Pagesetter/pnTemplates/plugins directory and there is no getPub plugin present. Should there be?

    Thanks

    Robbie
  • Posted: 25.09.2007, 17:07
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    getPub is a pagesetter function, that's part of the core.

    Hmmm...

    Have you tried $Z.name $Z.id etc... just to see...? How about just $Z, what does that yield?

    This is how I do it and I have no trouble...

  • Posted: 26.09.2007, 10:41
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Hi,
    Thanks for your input. I tried $Z.name, $Z.id etc.. but with no success. However, when I appended the field name (e.g. BookTitle, BookAuthor, BookImage etc) it worked perfectly.

    Code

    $Z.BookTitle


    Thank you so much for your all your help - as always the support is as great as the application.

    Regards

    Robbie

Template courtesy of Designs By Darren.