HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Customizing downloads & searching

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#102418 (In Topic #20070)
Avatar

Fan in training

Ok so this system is crazy complex lol

While trying to figure out what is what using the features like the Template Tree it appears I may not be able to figure it out without a little pointer (looks like 500 'templates' in this list 0_o). I am basically trying to figure out how to display any custom fields I have for a download in other places like the download category box that shows only the author, downloads, date, rating & a truncated description. If I could somehow get my custom fields to show up here as well, that would be fantastic.  

I also have another semi-related question. Those 'custom fields', they appear to be set up as Catalogues (go to downloads content, then choose "Choose custom 'Downloads' fields") and they are supposedly searchable (I selected the option to be allowed searched) but I can't seem to figure out how to search using the custom fields I have setup. Like for instance a multi-choice custom field for a download, say software types that belong to various OS's. I would like to be able to search for all Windows programs or Linux only. When the download is displayed, I would like it to show something like this

Windows: Check
Linux: X
Mac: X
Android: X
iOS: X

Something like that. So, anyway to put the 'Windows: Check' on the download category screen (just above the last screen of the download where the download's image gallery is, and where you can rate the file, etc.) and be able to search by those particular fields (like even under the advanced options for the search of downloads, I couldnt find a way)? I obviously understand I need to code in the code for the custom fields, but its that code that I can't seem to find. 

Thank you in advanced. Highly appreciate any help
Back to the top
 
Posted
Item has a rating of 5 (Liked by Guest)  
Rating:
#102427
Avatar

Ok so this system is crazy complex lol

Only when you try and customise complex stuff in it :P. I've talked about this recently, ocPortal should not be considered a substitute for having a programmer on complex custom projects.

While trying to figure out what is what using the features like the Template Tree it appears I may not be able to figure it out without a little pointer (looks like 500 'templates' in this list 0_o)

If there's 500 in the templates tree, my guess is you have a lot of blocks in active use. I'd advise against that, mainly for performance and user experience (clutter).

I am basically trying to figure out how to display any custom fields I have for a download in other places like the download category box

In DOWNLOAD_SCREEN.tpl these lines do it:

Code

{$SET,bound_catalogue_entry,{$CATALOGUE_ENTRY_FOR,download,{ID}}}
{+START,IF_NON_EMPTY,{$GET,bound_catalogue_entry}}{$CATALOGUE_ENTRY_ALL_FIELD_VALUES,{$GET,bound_catalogue_entry}}{+END}

I imagine they would transfer over to DOWNLOAD_BOX.tpl fairly easily.

and they are supposedly searchable

This setting is just a carry over from catalogues. Sorry, you can't extend the search system yet. Here's the tracker issue:
0000393: Custom fields on search - ocPortal feature tracker
It would be a particularly complex/challenging thing to implement, because the data is not in the same place as the actual primary content.
If you want to have a huge library of downloads, with searching on custom fields, this is not going to be close to straight forward – I would definitely worry about performance, and load testing it. Also, a multi-choice custom field is not stored in a search-friendly format itself, it's only parsed out for rendering, not indexable in the database – you'd need to make separate checkbox fields, and make them look nice via some fancy custom coding.

You can set up custom category filter UIs in v10, when that is released – but I can't promise this will be easy. You have to code up filter strings, get it into the display template, and tie it to a filter form.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: