#1284 ✓resolved
BJ Kline

Link manager column view?

Reported by BJ Kline | April 2nd, 2015 @ 06:07 PM | in User issues

Is there an easy way to have the link manager module display the links in a column? For example suppose you have 50 links, then after 25 are displayed in a column, the second 25 are displayed in a second column.

Comments and changes to this ticket

  • dleffler

    dleffler April 2nd, 2015 @ 08:39 PM

    • Assigned user changed from “expNinja” to “dleffler”
    • Milestone set to User issues

    Are you referring to the main showall view. Should be easy enough with css & smarty.

    • in a stylesheet or a style within the view
      • create a div associated style to 50% or whatever
    • in the view
      • immediately before the {foreach from=$cats key=catid item=cat} or {foreach name=items from=$items item=item} place the new div with the class
      • immediately after the closing {/foreach} for the above, place the closing div tag
      • immediately after the opening {foreach} above place this code
        {if $cats@iteration > count($cats)/2}
        </div>
        <div class="2col-class">
        {/if}
        

    I've not tested the above. And keep in mind that in both the showall.tpl and showall_quicklinks.tpl we have TWO routines based on whether or not 'use_categories' is set.

  • BJ Kline

    BJ Kline April 3rd, 2015 @ 01:02 PM

    Like this?

          <div class="links2">
                {foreach name=items from=$items item=item name=links}
                {if $cats@iteration > count($cats)/2}
    </div>
    <div class="2col-class">
    {/if}
                    <li class="item{if $smarty.foreach.links.last} last{/if}">
                        <a class="link{if !empty($config.websnapr_key)} websnapr{/if}" {if $item->new_window}target="_blank"{/if} href="{$item->url}" title="{$item->body|summarize:"html":"para"}">{$item->title}</a>
                        {permissions}
                            <div class="item-actions">
                                {if $permissions.edit || ($permissions.create && $item->poster == $user->id)}
                                    {if $myloc != $item->location_data}
                                        {if $permissions.manage}
                                            {icon img='arrow_merge.png' action=merge id=$item->id title="Merge Aggregated Content"|gettext}
                                        {else}
                                            {icon img='arrow_merge.png' title="Merged Content"|gettext}
                                        {/if}
                                    {/if}
                                    {icon action=edit text='notext' record=$item}
                                {/if}
                                {if $permissions.delete || ($permissions.create && $item->poster == $user->id)}
                                    {icon action=delete text='notext' record=$item}
                                {/if}
                            </div>
                        {/permissions}
                    </li>
                {/foreach}
                </div>
    

    Then in my stylesheet I added

    .links2 { width: 50%;}
    .2col-class {float:right;}
    

    That didn't change anything.

  • dleffler

    dleffler April 3rd, 2015 @ 02:58 PM

    I’ll work up an example at home a little later…I noticed the logic is bad, after the mid-point is reached, it adds the divs for every item thereafter (doh!)

    Dave Leffler

  • dleffler

    dleffler April 3rd, 2015 @ 03:32 PM

    Ok, I see you are using the quicklinks which is an unordered list 'ul' so the div's don't do anything...working on a sample

  • dleffler

    dleffler April 3rd, 2015 @ 03:40 PM

    The easiest solution for a 2 column unordered list 'ul' is found here http://stackoverflow.com/questions/17005407/creating-a-two-column-u... with an example here http://jsfiddle.net/audetwebdesign/4PdQw/

    It only requires adding a class ( class="two-col-special") to the opening 'ul' and then adding the styles (to the theme styles?)...you might want to change/remove the 'content' if you want/don't want a 'bullet'

  • BJ Kline

    BJ Kline April 3rd, 2015 @ 09:05 PM

    That example helped. I removed the following code from the 'li' on line 83 of showall_quicklinks.tpl, after moving the file into the appropriate folder in my theme.

    class="item{if $smarty.foreach.links.last} last{/if}"
    

    and added

    class="two-col-special"
    

    to the 'ul' on line 81.

    Now its working like I wanted. I guess I should have done more Googling. :)

  • dleffler

    dleffler April 4th, 2015 @ 10:06 AM

    • State changed from “new” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Bug Tracker for Exponent CMS

Shared Ticket Bins

People watching this ticket

Pages