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.


Link Catalogue Columns

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#46294 (In Topic #10113)

Fan in action

more than one column possible?

I have alot of links in my link catalogue separated into subcategories, but there are still about 30 urls per page and I'm trying to figure out how to make it so that there are 4 columns sorta like this:


website name OCPortal website name SMF
url http://ocportal.com
url http://simplemachines.org/



so that there is less empty space on the page.
I tried the other visual settings for the links catalogue, but currently i'm using the "field maps" option. It just seems like a waste to have half of the category page be empty

if i want to edit /portal/site/index.php?page=catalogues&id=17&type=category to create the columns which template page do I edit and what coding do I put in?O_o

sorry if this is in the wrong spot, but since it had to do with appearance i figured this would be the right area lol


Last edit: by wicked
Back to the top
 
Posted
Rating:
#46298
Avatar

Hi,

Yes it's the right forum. I'm going to quickly point you in the right direction. Take a look at the CATALOGUE_DEFAULT_ENTRY_EMBED template (which is the one used for field-map views on category screens)…

Code

<div class="wide_table_wrap"><table summary="{!MAP_TABLE}" class="wide_table solidborder spaced_table">
   <colgroup>
      <col width="150" />
   </colgroup>

   {FIELDS}
</table></div>

<div class="float_surrounder">
   <p style="float: left">
      <a href="#"><img class="inline_image" title="{!BACK_TO_TOP}" alt="{!BACK_TO_TOP}" src="{$IMG*,top}" /></a>
   </p>
   {+START,IF_NON_EMPTY,{VIEW_URL}}
      <p style="float: right">
         <a href="{VIEW_URL*}" title="{FIELD_0*}"><img title="{!VIEW}{+START,IF_PASSED,COMMENT_COUNT} ({$STRIP_TAGS,{$COMMENT_COUNT,catalogues,{ID}}}){+END}" alt="{!COMMENTS} / {!VIEW}" src="{$IMG*,pageitem/goto}" /></a>
      </p>
   {+END}
</div>

<br />

I haven't tested this, and I'm being quick and dirty with the coding, but I think something like this would work…

Code

<div class="wide_table_wrap" style="width: 24%; float: left"><table summary="{!MAP_TABLE}" class="wide_table solidborder spaced_table">
   {FIELDS}
</table></div>

I stripped the line break at the end, the hard-coded assumption for the width of the title field column, the view links, the back-to-top links. I made all the boxes float to the left and take up 24% width. I didn't use 25% as I'm not completely sure if there is any extra margins or padding on that div which would push it over 100% and break it. Maybe 25% will work. You might want to put colgroup back in there with a lower column width to keep the spacing consistent.


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:
#46335

Fan in action

Thank you for answering

That partially worked. Like you said, it removed the extra table space so the table itself is less empty, but it didn't create the extra column so the page is still longer than I'd like and there is still alot of unused space on the page.
How can I get it to create the secondary column? O_o
Back to the top
 
Posted
Rating:
#46336
Avatar

The float should have done that (by constraining the width of the boxes and telling them to sit side-by-side).

Could you attach a screenshot so we can see how it looks?


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:
#47199

Fan in action

sorry for the delay in reply, i had to completely redo my site after it crashed but I've done this again and it still looks like this:



continuously throughout the page.

how can i get it to do like 20 links in one column, then continue the links in a second column (or even a third), as I described in my original post?
Back to the top
 
Posted
Rating:
#47204
Avatar

I just tried the code I posted and didn't see that. What I saw was a mess, but it was put into columns. I tidied it up further, and this does 3 columns perfectly…

CATALOGUE_DEFAULT_ENTRY_EMBED

Code

<div style="width: 33%; float: left"><div class="wide_table_wrap" style="margin: 0 2px"><table summary="{!MAP_TABLE}" class="wide_table solidborder spaced_table">
   {FIELDS}
</table></div></div>

CATALOGUE_DEFAULT_CATEGORY_EMBED

Code

<div class="float_surrounder">
{ENTRIES}
</div>
{+START,IF_EMPTY,{ENTRIES}}
   <p class="nothing_here">
      {!NO_ENTRIES}
   </p>
{+END}

CATALOGUE_DEFAULT_CATEGORY_SCREEN

Code

{TITLE}

{+START,IF_NON_EMPTY,{DESCRIPTION}}
   <p>
      {DESCRIPTION}
   </p>
{+END}

{SUBCATEGORIES}

{+START,IF_NON_EMPTY,{ENTRIES}}
   <div class="float_surrounder">
      {ENTRIES}
   </div>
   <br />
{+END}

{+START,IF_EMPTY,{ENTRIES}{SUBCATEGORIES}}
   <p class="nothing_here">
      {!NO_ENTRIES}
   </p>
{+END}

{$,{TAGS} Uncomment if you wish to display tags}

{$,Load up the staff actions template to display staff actions uniformly (we relay our parameters to it)...}
{+START,INCLUDE,STAFF_ACTIONS}
   1_URL={ADD_LINK*}
   1_TITLE={!CATALOGUE_GENERIC_ADD,{CATALOGUE*}}
   2_URL={ADD_CAT_URL*}
   2_TITLE={!CATALOGUE_GENERIC_ADD_CATEGORY,{CATALOGUE*}}
   3_URL={EDIT_CAT_URL*}
   3_TITLE={!CATALOGUE_GENERIC_EDIT_CATEGORY,{_TITLE*}}
{+END}

<div style="display: inline-block" class="medborder centered_table special_category_sorter">
   <form action="{$URL_FOR_GET_FORM*,{$SELF_URL,0,1}}" method="get" style="display: inline">
      {$HIDDENS_FOR_GET_FORM,{$SELF_URL,0,1}}

      <div>
         <label for="c_order">{!SORT_BY}</label><br />
         <select id="c_order" name="order">
            {SORT_OPTIONS}
         </select>

         <div class="mini_proceed_button">
            <input type="submit" value="{!SORT}" />
         </div>
      </div>
   </form>
</div>

{BROWSER}


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:
#47221

Fan in action

alright thanks for your help :)
i've tried that with over 30 links, its still all in one column :(
how do i tell it to start making the other columns?
Back to the top
 
Posted
Rating:
#47229
Avatar

Try renaming the links catalogue to something different. I say this because there are some special overridden templates for the 'links' catalogue and they might be conflicting with my changes above. I tested the changes on the 'hosted' catalogue, and only just realised that.

Also make sure you're editing the templates properly - from within ocPortal, and into the active theme you're viewing.

If it still won't work I'm baffled as we both seem to be running Firefox 3 and my above code isn't so complex as to be unstable.


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:
#47244

Fan in action

thanks for your help again :)
i got it to work, but there is a tiny error. Did i do something wrong?
The box around the staff actions seems to be going around the links table after line 1

also, i know its not visible in this screenshot, but the links themselves arent in any particular order once they're moved into columns.
how it is now:
 A            Ar         T
 As           Ar         B
 I             En         G

It's not really a big issue but is it possible to put them in some sort of alphabetical order?
Horizontally
A  Ab Ac
B  Ba  Be

or
Vertically
A   N    S
Ab  No   Se

sorry for asking so many questions lol
Back to the top
 
Posted
Rating:
#47245
Avatar

Community saint

I think you will need a

Code

<br />
in there.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#47270
Avatar

Actually it's due to the
CATALOGUE_DEFAULT_CATEGORY_SCREEN change not applying properly (not sure why that's not applying, maybe the change was forgotten).

The float_surrounder bit in there solves the problem.


The order thing is a bug. In sources/catalogues.php look for:

Code

            $a=@$entries[$j]['map']['FIELD_'.strval($order_by)];
            $b=@$entries[$i]['map']['FIELD_'.strval($order_by)];
and add two lines after those:

Code

            if (is_object($a)) $a=$a->evaluate();
            if (is_object($b)) $b=$b->evaluate();

Sorry for the inconvenience there.


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:
#47378

Fan in action

i've tried reapplying the change several times, still not working. I've also put <br /> in several places in the CATALOGUE_DEFAULT_CATEGORY_SCREEN template, still seems to be overlapping :(

but thank you for the fix for the organization, its now in alphabetical order :)
Back to the top
 
Posted
Rating:
#47394
Avatar

For the links catalogue you'll need to edit CATALOGUE_links_CATEGORY_SCREEN instead-of/in-addition-to CATALOGUE_DEFAULT_CATEGORY_SCREEN.


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: