Subject: Home page to the style Joomla

Posted on: 26/09/08 02:58pm
By: koalasoft

Hello !!

In theme Geeklog the new view in form the cell .. but ..

I would like that my news appeared in the form of blocks, as well as the Home Page of cms joomla .. for example .. this image
PHP Formatted Code
http://i33.tinypic.com/24erm82.jpg


Somebody can give an idea me of how I can do so that it only appears in the Home Page the news like in the image??

Grettings !! Mr. Green

Re: Home page to the style Joomla

Posted on: 26/09/08 05:26pm
By: beewee

Have a look over here. I'm afraid it doesn't work with newer Geeklog versions.

Re: Home page to the style Joomla

Posted on: 26/09/08 06:44pm
By: koalasoft

god !! but ..

this hack is for geeklog 1.3 .. and my site have Geeklog 1.5.1 ..

this hack I do not working in 1.5.1 .. y very very change in index.php ... Cry

Grettings !!

Re: Home page to the style Joomla

Posted on: 27/09/08 02:36pm
By: 1000ideen

You mean a two columns layout of the stories? http://www.geeklog.net/forum/viewtopic.php?showtopic=71001
http://www.geeklog.net/forum/viewtopic.php?showtopic=38522

Seems to be a feature that is being asked for every now and again.

Re: Home page to the style Joomla

Posted on: 30/09/08 01:46pm
By: koalasoft

Quote by: 1000ideen

You mean a two columns layout of the stories? http://www.geeklog.net/forum/viewtopic.php?showtopic=71001
http://www.geeklog.net/forum/viewtopic.php?showtopic=38522

Seems to be a feature that is being asked for every now and again.



I do not way . but in GK 1.5.1 not working !! Cry

Re: Home page to the style Joomla

Posted on: 17/10/08 06:52pm
By: koalasoft

and .. !!

other idea for my ??? :pray:


Grettings !! Mr. Green

Re: Home page to the style Joomla

Posted on: 17/10/08 11:24pm
By: Anonymous

Quote by: koalasoft

and .. !!

other idea for my ??? :pray:


Grettings !! Mr. Green


how about create a static page and set to featured with no right block. insert the news menully in the table.

PHP Formatted Code
<tr>
<th><center>Page 1 title</center></th>
<th><center>Page 2 title</center></th>
</tr>
<tr>
<td bgcolor="#ff9966" valign=top>
<ul><li>put your first news here.
<li>feature news 2.
<li>feature news 3.
<li><a href="http://yoursite.com/staticpages/index.php?page=2008101714094xxxx">feature news 3</a>
<li>news tible 4.
<li><a href="http://yoursite.com/staticpages/index.php?page=200810171354xxxx">news tible here</a>
</td>
<td bgcolor="#99CC33" valign=top>
<ul><li>Myspace
<li>Yahoo
<li>Google
<li>Window Live
<li>Your page2
<li>Your page3
</td>
</tr>
</table>
 



Re: Home page to the style Joomla

Posted on: 17/10/08 11:27pm
By: hfd

how about create a static page and set to featured with no right block. insert the news menully in the table.

PHP Formatted Code

<table border="0" height="160" width="550" align="center">
<tr>
<th><center>Page 1 title</center></th>
<th><center>Page 2 title</center></th>
</tr>
<tr>
<td bgcolor="#ff9966" valign=top>
<ul><li>put your first news here.
<li>feature news 2.
<li>feature news 3.
<li><a href="http://yoursite.com/staticpages/index.php?page=2008101714094xxxx">feature news 3</a>
<li>news tible 4.
<li><a href="http://yoursite.com/staticpages/index.php?page=200810171354xxxx">news tible here</a>
</td>
<td bgcolor="#99CC33" valign=top>
<ul><li>Myspace
<li>Yahoo
<li>Google
<li>Window Live
<li>Your page2
<li>Your page3
</td>
</tr>
</table>
 



Re: Home page to the style Joomla

Posted on: 18/10/08 12:16pm
By: koalasoft

Good… this example is good, but it is not what I look for, I put as it in the image, I want to see if there is the possibility that the articles in the main page appear in the form of columns to the Joomla style but that is made automatically.

Grettings !! Mr. Green

Re: Home page to the style Joomla

Posted on: 18/10/08 01:18pm
By: hfd

Quote by: koalasoft

Good… this example is good, but it is not what I look for, I put as it in the image, I want to see if there is the possibility that the articles in the main page appear in the form of columns to the Joomla style but that is made automatically.

Grettings !! Mr. Green


I think Geeklog can't do that way. because joomla and geeklog are difference code, form and much more. what you looking for is a new rebuild geeklog. I guess geeklog have to do some thing difference from joomla. they will not follow joomla style any way.

if you really what to use geeklog as the way joomla do. I think you have to pay for a programmer to rebuild geeklog as joomla for you. (my opinion).

I am waiting to see Geeklog 2 to see how the look.

thanks.

Re: Home page to the style Joomla

Posted on: 18/10/08 06:18pm
By: ::Ben

Hi Koalasoft,

With a hack of the index.php you could enclose the render of the first half of the stories in a div (float left and width 50%) witch will display stories on the left and for the second half another div for stories on the right.

If you have 6 stories per pages:
for story 1 to 3 > display left
for story 4 to 6 > display right

Like this, every page (page=1, page=2... topic=1, topic=2...) will be 2 colons like on Joomla.

::Ben

Re: Home page to the style Joomla

Posted on: 18/10/08 07:33pm
By: Anonymous

Quote by: cordiste

Hi Koalasoft,

With a hack of the index.php you could enclose the render of the first half of the stories in a div (float left and width 50%) witch will display stories on the left and for the second half another div for stories on the right.

If you have 6 stories per pages:
for story 1 to 3 > display left
for story 4 to 6 > display right

Like this, every page (page=1, page=2... topic=1, topic=2...) will be 2 colons like on Joomla.

::Ben



I wonder, could it be possible to use a variable in place of the hack you made above and place the changes in the functions.php file of the theme? Cuz then this could go a long ways. All the admin would have to do is just change out that index file or make the changes in it. Then theme devs could program for that in the themes.

Just my :twocents: worth

Michael

Re: Home page to the style Joomla

Posted on: 19/10/08 12:33pm
By: ::Ben

Hi,

Another idea, if your don't want to hack the index.php file, is to make a plugin and with the function PLG_showCenterblock you could replace the entire index page.

::Ben


Re: Home page to the style Joomla

Posted on: 19/10/08 02:55pm
By: ::Ben

Michael (sorry for my late response),

To replace the normal content by another in the index page and because it's not only a variable, a easy way is to get code from a hack, a static page or a plugin.

functions.php in the template folder is more for content order and template variables.

::Ben

Re: Home page to the style Joomla

Posted on: 19/10/08 06:11pm
By: ::Ben

William,

This hack is working. Maybe you will have to theme the divs.

In index.php near line 317
PHP Formatted Code

    // get remaining stories
       
        $storycount = 2;
        $limit = 1+((int)($nrows/2));
               
        $display .= '<div id="columnleft" style="float:left; width:48%;padding-right:10px;">';
               
    while ($A = DB_fetchArray ($result)) {
        $display .= $storycount . "/" . $nrows . ' ' . $limit;
        $story = new Story();
        $story->loadFromArray($A);
        $display .= STORY_renderArticle ($story, 'y');
        if ($storycount >= $limit)
                    break;
        $storycount++;
    }
        $display .= '</div>';
        $display .= '<div id="columnright" style="float:right; width:48%;padding-right:10px;">';
               
    while ($A = DB_fetchArray ($result)) {
        $display .= $storycount . "/" . $nrows;
        $story = new Story();
        $story->loadFromArray($A);
        $display .= STORY_renderArticle ($story, 'y');
        $storycount++;
    }

        $display .= '</div><div style="clear:both"></div>';
                       
    // get plugin center blocks that follow articles


::Ben

Re: Home page to the style Joomla

Posted on: 03/11/08 04:10am
By: Anonymous

Quote by: cordiste

William,

This hack is working. Maybe you will have to theme the divs.

In index.php near line 317


::Ben



Thank you, Cordiste! It work great in GL 1.5.1. But can you made code that will working in GL 1.4.1 or what I need to do that it works? thank you

Re: Home page to the style Joomla

Posted on: 03/11/08 11:06am
By: beewee

That looks like a great hack Big Grin . Is a featured article still full width? When yes, this would be nice to make this a standard feature for GL 1.52. I'm no developer Mr. Green , but I'm sure there is a way to put this in the config. options.

Re: Home page to the style Joomla

Posted on: 03/11/08 12:51pm
By: koalasoft

Working .. perflectly

Super perfecto .. !!

Thank's Cordise !!

Grettings !!

Re: Home page to the style Joomla

Posted on: 03/11/08 02:01pm
By: ::Ben

Hello,

That looks like a great hack Big Grin


Just a little one Smile

I'm working to a new plugin call "Blocks plugin" witch allow to replace content by a block... and in a block you can put a hack. So this hack would be available if you need it.

I'm looking for some cool old php blocks and will add them to this Blocks manager plugin. There will be a place for this one too before the next media gallery release.

Maybe it's a good way to allow hacks without hacking the core.

::Ben

Re: Home page to the style Joomla

Posted on: 05/12/08 12:58pm
By: KungfuBeer

Quote by: cordiste

William,

This hack is working. Maybe you will have to theme the divs.

In index.php near line 317

PHP Formatted Code

    // get remaining stories
       
        $storycount = 2;
        $limit = 1+((int)($nrows/2));
               
        $display .= '<div id="columnleft" style="float:left; width:48%;padding-right:10px;">';
               
    while ($A = DB_fetchArray ($result)) {
        //$display .= $storycount . "/" . $nrows . ' ' . $limit;
        $story = new Story();
        $story->loadFromArray($A);
        $display .= STORY_renderArticle ($story, 'y');
        if ($storycount >= $limit)
                    break;
        $storycount++;
    }
        $display .= '</div>';
        $display .= '<div id="columnright" style="float:right; width:48%;padding-right:10px;">';
               
    while ($A = DB_fetchArray ($result)) {
        //$display .= $storycount . "/" . $nrows;
        $story = new Story();
        $story->loadFromArray($A);
        $display .= STORY_renderArticle ($story, 'y');
        $storycount++;
    }

        $display .= '</div><div style="clear:both"></div>';
                       
    // get plugin center blocks that follow articles


::Ben



This works great!!! Thanks for the code!

I did comment out both of these, so the story count does not show.
PHP Formatted Code
$display .= $storycount . "/" . $nrows . ' ' . $limit;

Re: Home page to the style Joomla

Posted on: 10/04/09 01:37pm
By: usarfans

cordiste provided a wonderful and easy to implement solution for two columns on the main page. It's working well for me as too but I have one question. Can the code be modified so that the chronology of the articles displayed is changed? With cordiste's code, the left column takes the first 5 stories based on date, after the feature story, and puts them in the left column. It then goes back to the to top and the right column and puts the remaining articles. They are arranged like this:
Left              Right
April 10        April 5
April 9         April 4
April 8         April 3
April 7         April 2
April 6         April 1
It looks nice but I was wondering if a change could be made to have the articles alternate left -- right -- left -- right, etc. based on date of the article so the most recent are always on top of other articles. Like this:
Left              Right
April 10        April 9
April 8         April 7
April 6         April 5
April 4         April 3
April 2         April 1
Does this make sense? I did my best to look at the code and see if I could do it myself, but quite frankly, I'm just not smart enough! Thanks for any thoughts on the matter. Lou

Re: Home page to the style Joomla

Posted on: 10/04/09 03:26pm
By: ::Ben

Hello,

@KunfuBeer

Counts were here to test, it is cleaner to remove them on a productive site Wink

@usarfans

Are you looking for something like this one?

PHP Formatted Code

    // get remaining stories
       
        $storycount = 2;
       
    while ($A = DB_fetchArray ($result)) {
        $story = new Story();
        $story->loadFromArray($A);
                if (($storycount) % 2 == 0)
        {
           $display .= '<div id="columnleft" style="float:left; width:48%;padding-right:10px;">';
                   $display .= STORY_renderArticle ($story, 'y');
                   $display .= '</div>';
        }
           else
        {
           $display .= '<div id="columnright" style="float:right; width:48%;padding-right:10px;">';
                   $display .= STORY_renderArticle ($story, 'y');
                   $display .= '</div>';
                   // Comment out this next line if you do not need horizontal alignment 2 stories by 2
                   $display .= '<div style="clear:both"></div>';
        }
                $storycount ++;
                 

    }        
        $display .= '<div style="clear:both"></div>';
                       
    // get plugin center blocks that follow articles


::Ben

Re: Home page to the style Joomla

Posted on: 10/04/09 03:28pm
By: usarfans

Quote by: cordiste

@usarfans

Are you looking for something like this one?
::Ben



I'll try it out tonight and let you know! Thanks for the very fast reply!

Lou

Re: Home page to the style Joomla

Posted on: 10/04/09 03:38pm
By: Dirk

Just curious: Has anyone tried using the {story_counter} variable? It's increased for every story (0 for the featured story, 1 for the first, 2 for the second, and so on). I was wondering if you could use something like class="story{story_counter}" (and CSS classes like story0, story1, etc.) to produce a two-column layout without any actual code changes?

bye, Dirk

Re: Home page to the style Joomla

Posted on: 10/04/09 05:41pm
By: ::Ben

Yes it is working Smile

This is storytext.thtml
PHP Formatted Code

<div class="story{story_counter}">
    <span class="story-icons">
        {email_icon}
        {print_icon}
        {pdf_icon}
        {edit_icon}
    </span>
    <h1>{story_title_link}</h1>
    <div class="story-information">
        <p>{story_date}</p>
        <p>{lang_contributed_by} {start_contributedby_anchortag}{contributedby_author}{end_contributedby_anchortag}</p>
        <p>{lang_views} {story_hits}</p>
    </div>
    <div class="story-body">
        {story_anchortag_and_image}{story_text_no_br}
    </div>
    <div class="story-footer">
        <p>{page_selector}</p>
        <p>{readmore_link} {post_comment_link}</p>
        <p>{plugin_itemdisplay}{comments_with_count} {trackbacks_with_count}</p>
    </div>
</div>


and new classes in style.css

PHP Formatted Code

.story3 , .story5, .story7, .story9, .story11, .story13, .story15{
  float:left;
  width:48%;
  padding:10px 10px 10px 0px;
  background:transparent;
  color:#000000;
}
.story2, .story4, .story6, .story8, .story10, .story12, .story14, .story16{
  float:left;
  width:48%;
  padding:10px 10px 10px 0px;
  background:transparent;
  color:#000000;
}


If you wish to add content after the stories make a staticpage starting with

PHP Formatted Code
<div style="clear:both;"></div>


::Ben

Re: Home page to the style Joomla

Posted on: 10/04/09 05:53pm
By: ::Ben

And if you need three columns

PHP Formatted Code

.story3 , .story5, .story7, .story9, .story11, .story13, .story15, .story2, .story4, .story6, .story8, .story10, .story12, .story14, .story16{
  float:left;
  width:31%;
  padding:10px 15px 10px 0px;
  background:transparent;
  color:#000000;
}
 


::Ben

Re: Home page to the style Joomla

Posted on: 11/04/09 03:22pm
By: usarfans

cordiste,

The code you provided to reorder the two columns chronology worked well. Thank you!

I did make two minor changes. The first one was to comment out the line that lined up the top of the stories. For my site it caused too much blank white space for my taste.

The second change added an extra <br> after the articles and before the plugin centerblocks, mostly just for my personal preference.

Thanks again. I have not tried the optional method of using story1, story2, etc. Didn't want to push my luck with editing two files :-)

Lou

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=84604