Asset selections and targets


(Anewport) #1

I'm trying to utilise the Asset Selections screen of an Asset Listing Page to get the selections of the list to be displayed on the Target page. I'm lost as to how to get the selections to be actually displayed on the target asset.


I've got an asset lister displaying comments, multiple selections are allowed, and when they click the target button, they should be taken to a Standard Page with the asset id's of the selected comments. Is this something that can only be done with assets from the e-commerce section?


(Anewport) #2

Found a solution to this problem I had a while ago so I'm updating this thread with a solution in response to http://forums.squizsuite.net/index.php?showtopic=11756 and anyone else who comes upon this thread looking for answers.

 

Solution steps (you can name your assets whatever suits your needs):

  1. Create two Asset Listings - 'Selection List' and 'Display Selection'
  2. For the 'Selection List' listing:
    1. Configure it to display the assets you want to select by choose the Asset Types to List, Root Nodes, and Asset Statuses to List
    2. On the Asset Selections screen under Asset Selections enter a name in the Add New Selection field - 'selectionItems'
      • After you commit you will be able to choose the type of selection. For this example choose 'Radio Buttons' and check 'Allow multiple selections'
    3. On the same screen under Asset Targets enter a name in the Add New Target field - 'target'
      • After you commit you will be able to enter some text for the button users will click on and the asset to send the selection to - make sure this asset is the 'Display Selection' listing created in Step 1
    4. On the Default Format Bodycopy enter the following where %selectionItems_asset_selection% matches what you entered in Step 2.2: 
      %selectionItems_asset_selection% - %asset_name%<br>
    5. On the Page Contents Bodycopy enter the following:

      <h1>Make a selection</h1>
      %asset_listing%
      %targetName_asset_target%
  3. For the 'Display Selection' listing:

    1. Configure it to display the assets you want to select by choose the Asset Types to List, Root Nodes, and Asset Statuses to List which should be the same settings from Step 2.1

    2. On the Details screen under 'Dynamic Parameters' choose 'Array of specific asset IDs or selection group (specified assets must be children of the static related node)' and set it as 'GET Variable Name'

    3. On the Default Format Bodycopy enter the following:

      %asset_name_linked%<br>
    4. On the Page Contents Bodycopy enter the following:

      <h1>Your selection:</h1>%asset_listing%

 

Done.

 

This allows the selected assets from the first listing to be displayed on the second listing thus you can modify the format on the second listing to display more information about the assets or whatever you need. Taking this further the first listing ('Selection List' in the example above) could potentially be a Search Page asset which lets you search for some assets then select a few to pass to another page making this a bit more dynamic.

 

Worth noting that if there are no selections made (i.e. nothing in the GET variable) when viewing the second listing ('Display Selection' in the example above) then it will just print out the root node and all matching assets so although I haven't tested this far it could be worth applying a Paint Layout with a Conditional Keyword to check for the GET variable and display a suitable message if it is empty or missing.