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.


I want to add a field title

Login / Search

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

Community saint

I want to add the field titles to the following code:
<div class="surround">
   <div class="float_surrounder">
      <div style="width:200px; float:left;">
      <span style="font-weight:bold;"><a href="{VIEW_URL*}" title="{!VIEW}: {$STRIP_TAGS*,{FIELD_0}}">{FIELD_0}</a></span><br />
         {FIELD_1}<br />
         {FIELD_2}<br />
         Owner: {FIELD_3}<br />
         Submitter: FIELD_4}
      </div>
      <div style="width:50%; float:right;">
         {FIELD_5}
      </div>
      <div style="clear: both;"></div>
   </div>
<hr />
</div>

Do I need to just wrap some semihtml tags around this?

Thanks for any help.

Bob
Back to the top
 
Posted
Rating:
#74139
Avatar

I'm a bit confused by what you mean. But the titles for fields can be retrieved via template parameters. You can get a full output of parameters (so you know what to use) by temporarily including this code:

Code

{+START,PARAM_INFO}{+END}


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:
#74141
Avatar

Community saint

I was looking to cheat and just output some HTML as the header for those two fields but I guess I should just learn to do it the right way.

But, hey, I got the email that you replied!!  :)

Bob
Back to the top
 
Posted
Rating:
#74142
Avatar

Oh, well it's just a template.


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:
#74143
Avatar

Community saint

Chris Graham said

Oh, well it's just a template.
Easy for you to say.

So I put that line in as below:
<div class="float_surrounder">
   <div class="float_surrounder">
      <div style="width:150px; float:left;">
      {+START,PARAM_INFO}{+END}
      {FIELD_1}<br />
      {FIELD_2}<br />
      {FIELD_3}<br />
      {FIELD_4}
      <br /><br /><br />
      {$COMCODE,View large image}
      </div>
      <div style="width:75%; float:right;">
      {FIELD_5}
      </div>
   </div><br /><br />
   <div style="clear:both;"</div>
   <div style="width:100%;">
   {FIELD_6}
   </div>

</div>

Where do I find the field names? In Firebug?

Bob
Back to the top
 
Posted
Rating:
#74144
Avatar

You should see a huge table of them in your output. It may be obscured by that 150px width, but yeah you can use Firebug to fiddle with whatever you need to make it easier to see-- or just copy and paste into a word doc.


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:
#74147
Avatar

Community saint

Okay, I got the display of the variables. The one I am interested in is:

Code

<tr> <th>Member</th> <td><a href="http://xxxxxxxxxx.com/members/view/xxxxxxxxx.htm">xxxxxxxxx</a></td> </tr>

I want to display the table header "Member" in front of the link. I am guessing this is done with Tempcode but after reviewing the Temcode tutorial at ocPortal Tutorial: Tempcode programming - ocPortal, I am none the wiser. How would I output the table header using Tempcode?

Thanks for your help.

Bob
Back to the top
 
Posted
Rating:
#74151
Avatar

Community saint

Hmmm….I think I just had a revelation.

Is it correct that I can just put a variable like "{FIELDNAME_2}" in front of the field variable?

What if I want to format it so that there is a colon and space after the fieldname?

Yes, I'm a slow study but I can be persistent. I'm still banging my head against the one redirect to replace the 'news' with the 'blog' choices. If only there were another a8 hours in the day and I still required only a minimum of sleep. Oh wait, then I'd be like Chris.  LOL

Bob

EDIT: Happy, happy, joy, joy and I learned something new. Now I just need to figure out how to format the title field in bold and add the colon and nbsp.


Last edit: by BobS
Back to the top
 
Posted
Rating:
#74153
Avatar

Community saint

YES!!!! I've got it working.

I'm so happy I could drink except I have no tequila here.

Thanks for the pointer Chris.

Bob
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: