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.


Get a field value from a catalogue entry (v8)

Login / Search

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

Well-settled

This is a pretty straightforward thing which I've been busting my head on how to do since v6.

I have a jquery script that shows 4 videos from youtube.
The links are hardcoded. I have a catalogue with 4 fields and a single entry.
How can I get the values of these entries and pass them on to the links to the youtube videos?
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jean)  
Rating:
#94787
Avatar

Temporarily add {+START,PARAM_INFO}{+END} to your CATALOGUE_ENTRY_SCREEN template and it'll print out a table of parameters for you. You'll see all catalogue fields are passed in.


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
 
Posted
Rating:
#94858
Avatar

Well-settled

Hey Chris, thanks for the reply :)
I did what you said and I get parameters like {FIELD_0} etc in a catalogue entry.
What I want to know though, is if it's possible to do something like this:

{CATALOGUE-ENTRY-ID_xx, FIELD_0}

In plain words, whether it's possible to retrieve a catalogue field's value from anywhere.

As I said I have a hardcoded jquery (front page in metal-temple.com) that shows 4 vids from youtube. Each time I want to change which 4 vids these are, I have to do the changes directly in the code.

I need to have a way for my chief editor (who has no administrator access) to be able to easily change 4 values with youtube's code. Maybe there is something simpler I could do that I am missing? :S
Back to the top
 
Posted
Rating:
#94859
Avatar

{$CATALOGUE_ENTRY_FIELD_VALUE,123,0} – think that works on v8, definitely should on v9. 123 is the entry ID.


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
 
Posted
Rating:
#100587
Avatar

Fan in training

I am trying this in the wiki.  I use pretty much a copy/paste from Chris's entry above (with a smaller number than 123 though).

It works in preview, but not after I save.  It just shows the raw code.  
1. Am I missing the obvious in making this work?
2. Even if point 1 is true, shouldn't preview and saved version behave the same, anyway?
Back to the top
 
Posted
Rating:
#100588
Avatar

Ah, you have an interesting problem here.

We recently made a change to how ocPortal permissions work. When editing something by another user, the ownership for permissions stays with that original user. This is to stop an issue where an admin may edit something a non-admin made, not notice something insecure in it, and escalate it to their own permissions due to the edit.

In this case, the home Wiki+ page is set as owned by guest during installation.

Using Tempcode requires admin privileges.

To fix, execute this SQL query:

Code

UPDATE ocp_seedy_pages SET submitter=2 WHERE id=1;


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
 
Posted
Rating:
#100590
Avatar

Actually my answer was incomplete.

You also need this query:

Code

UPDATE ocp_translate SET source_user=2,text_parsed='' WHERE id=(SELECT description FROM ocp_seedy_pages WHERE id=1);

Note to other users: we will update ocp v10 to assign ownership of default categories to admin.


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: