Jump to content
Sign in to follow this  
Keith Vaugh

Column width

Recommended Posts

Keith Vaugh+    14
Keith Vaugh

Hi Folks.

 

I am having a problem with a site and in particular the URL: http://www.etterhorses.com/new_site/links/

 

As you can see there is [column width=....] [/column] contained in the page. If I recall Adam pointed me towards this feature and I suspect there is some code that needs to be added somewhere which was over written during an update. Can't seem to locate the original question and solution in the forum and wondering if anyone recognises it. 

 

Thanks in advance

 

Share this post


Link to post
Share on other sites
Keith Vaugh+    14
Keith Vaugh

Hi Catrina

You might try it now. I didn't realise that I had a PW on the site folder.

If the PW popup appears just cancel it (twice) and you should be on the site.

Share this post


Link to post
Share on other sites
Rob    547
Rob

Keith,

 

Nothing I know of uses [column...] in PageLines own code, unless I'm missing something.  Is this a plugin? Is it activated?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob    547
Rob

You could achieve the same results using boxes or soapboxes. Have you tried those?

 

The shortcodes you're using belong to this plugin:

http://wordpress.org/extend/plugins/column-matic/


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Keith Vaugh+    14
Keith Vaugh

Hi Rob

It's going back a few years, and a site I build using PlatformPro. I think Adam Munns give me the fix, but I can't located the original post in the forum. It was a method of creating columns, but I think there is some additional code needed. It wasn't available out of the box in pagelines, but could be implemented.

Share this post


Link to post
Share on other sites
Rob    547
Rob

Keith,

 

I've been using PageLines products since before PlatformPro. I dont' ever recall this as previous editions didn't really use shortcodes as Framework does now. The code Adam gave you is part of a plugin. He may have recommended it, and described how to implement it.

 

As I mentioned above, those codes work with the plugin I linked.  I do recall many people asking in my earlier days here about columns, and we've always recommended boxes, soapboxes, or plugins.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
James B    436
James B

Hi Keith

 

I think this code was done through a plugin, i think jw shortcodes had that setup for creating columns.

 

However, you can now create that using shortcodes from inside Pagelines now, using the Pagelines grid (as you're using the Framework now etc).

 

The grid uses html code, you can see an example of the code which uses spans to create the columns here http://demo.pagelines.me/tools/

 

However, one of our developers has done a free shortcode version (which will be even easier), you can find that at - http://www.pagelines.com/store/plugins/grid-shortcodes/


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
Keith Vaugh+    14
Keith Vaugh

Just an update on this. I located the code that was required to enable the functionality. Adam originally pointed me to a website that is no longer live. This code was added to the functions.php file (Not a good practice).

function atlas_clean_shortcode_content( $content ) {
 
    /* Parse nested shortcodes and add formatting. */
    $content = trim( wpautop( do_shortcode( $content ) ) );
 
    /* Remove '</p>' from the start of the string. */
    if ( substr( $content, 0, 4 ) == '</p>' )
        $content = substr( $content, 4 );
 
    /* Remove '<p>' from the end of the string. */
    if ( substr( $content, -3, 3 ) == '<p>' )
        $content = substr( $content, 0, -3 );
 
    /* Remove any instances of '<p></p>'. */
    $content = str_replace( array( '<p></p>' ), '', $content );
 
    return $content;
}
 
/**
 * Flexible columns shortcode.
 * @param array $atts array of shortcode attributes
 * @param string $content the content between the shortcode tags
 * @return string
 */
function atlas_column_shortcode( $atts, $content = '' ) {
 
    /* Extract shortcode attributes. */
    extract( shortcode_atts( array(
      'width' => '45%',
      'spacing' => '0',
        ), $atts ) );
 
    /* Parse any nested shortcodes and clean up the formatting. */
    $content = atlas_clean_shortcode_content( $content );
 
    /* Assemble the output. */
    $style = "style='float: left; width: {$width}; margin-right: {$spacing};'";
    $output = "<div {$style}>{$content}</div>";
 
    return $output;
}
 
/**
 * Clear shortcode columns.
 * @return string
 */
function atlas_clear_columns_shortcode() {
    return "<div style='clear: both;'></div>";
}
 
/* Register column shortcodes. */
add_shortcode( 'column', 'atlas_column_shortcode' );
add_shortcode( 'end-columns', 'atlas_clear_columns_shortcode' );

Then in on the page add this changing the %'s

[column width='30.66%' spacing='4%']
Your content goes here.
[/column]
 
[column width='30.66%' spacing='4%']
Your content goes here.
[/column]
 
[column width='30.66%']
Your content goes here.
[/column]
 
[end-columns]

Share this post


Link to post
Share on other sites
James B    436
James B

Hi Keith,

 

Ah ok, it was a php solution. I definitely say you're better off with the grid shortcodes that using that now that pagelines has it embedded. Well done for tracking it down though, I went through the forum search a couple of times looking for a previous post with the code in but couldn't track it down.

  • Like 1

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
Keith Vaugh+    14
Keith Vaugh

The grid shortcuts are the way to go. I guess this was a fix before them. I had trouble tacking it also myself, but eventually I decided to google my own username and column and it popped me back to a post where I had shared it with someone else also. It's a shame we can't search for our old posts

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×