Support ⇒ Explain Please :: Archives ⇒ How to have 2 news side by side? :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexExplain Please

Archived ⇒ How to have 2 news side by side?


Right, I've nearly got a second added, but can't quite get it right, I'll post the code up to see if someone else can get it sorted, as I may not look at it again tonight.

<!-- DEFINE $LEFT_ARTICLE = false --> <table align="center"><tr> <!-- BEGIN newstopic --> <td width="50%"> <a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a> <span class="legend">{newstopic.S_TITLE}</span> <font size="2" color="#000000">{newstopic.S_STORY} <!-- IF newstopic.S_NOTES --> <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i> <!-- ENDIF --> </font><br /> <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font> <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div> </td> <!-- IF $LEFT_ARTICLE --> </tr></table><table><tr><td><!-- DEFINE $LEFT_ARTICLE = false --></td> <!-- ELSE --> </tr><tr> <!-- DEFINE $LEFT_ARTICLE = true --> <!-- ENDIF --> <!-- END newstopic --> </tr></table>

That gives me this:

Story 1
Story 2
Story 3 - (Blank Space)
(Blank Space) - Story 4
Story 5 - (Blank Space)

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


The Journey Continues Very Happy

In my quest to gain the following theme behaviour

Story 1
Story 2
Story 3 - Story 4
Story 5 - Story 6

I have somehow managed to come up with the complete opposite, and currently have

Story 1 - Story 2
Story 3
Story 4
Story 5
Story 6

I'll post the code up just in case someone wants this type of behviour, or if someone can help me find out where I've gone wrong. I keep thinking I'm so close to achieving my goal, then it goes wrong again Sad

<!-- DEFINE $LEFT_ARTICLE = false --> <table align="center"><tr> <!-- BEGIN newstopic --> <td width="50%"> <a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a> <span class="legend">{newstopic.S_TITLE}</span> <font size="2" color="#000000">{newstopic.S_STORY} <!-- IF newstopic.S_NOTES --> <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i> <!-- ENDIF --> </font> <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font> <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div> </td> <!-- IF $LEFT_ARTICLE --> </tr></table><table><tr> <!-- ELSE --> <!-- DEFINE $LEFT_ARTICLE = true --> <!-- ENDIF --> <!-- END newstopic --> </tr></table>

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


Unless a member of the Dev Team can point me in the right direction, I now believe it is currently improssible to create this behaviour with Dragonfly, almost certainly not by using the code DJMaze pasted earlier as a base.

In one of my earlier posts I thought I had created the beginnings of it by having:

Story 1
Story 2 - Story 3
Story 4 - Story 5

However, it turns out this is only because there were an odd number of stories on the page, in this instance, adding a 6th story creates the following look:


Story 1
Story 2 - Story 3
Story 4 - Story 5
Story 6

So, sadly, I'm throwing in the towel. Hopefully a member of the Dev team with more of an idea behind the templating system could give some pointers as to whether or not this is possible.

I'm very happy to do the leg work on this if someone has any ideas, unfortunately I've used up all mine. Sad

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


try making a seperate file called articles2.html for a side by side format and then find a way to specify wich template is called

just an idea

Please enter your server specs in your user profile! 😢


Its a good idea. I tried something similar by using Phoenix's latest news block, the trick is though how to stop duplicate stories occuring.

For example, you have the 5 latest news stories at the top of your site. The next story has to be story 6, but by stating stories should start there, begins at Story 1 again. To my knowledge, there's no way of saying, for example:

<!-- Start Stories (-6) Here -->

Or something like that.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


So, I just wanted to ask where has all this ended up. I need to work up a theme that looks like a news paper with a 2 colum style thing going on. Any word . . . ?

Gerald Scott
Asheville, NC US

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )


Just a note here. I used DJMaez's code snip, I added the table class direction and bang two colums in the main page view and one in the read more. I reposting the code just because I can. . . Rolling Eyes

<!-- DEFINE $LEFT_ARTICLE = true --> <table><tr> <!-- BEGIN newstopic --> <td class="newsarticle"> <a href="{newstopic.U_NEWTOPIC}"><img src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /></a> <span class="legend">{newstopic.S_TITLE}</span> <font size="2" color="#000000">{newstopic.S_STORY} <!-- IF newstopic.S_NOTES --> <br /><br /><b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i> <!-- ENDIF --> </font><br /> <font size="1" color="#035D8A">{newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_TIME}</font> <div align="right"><span class="storyfoot">{newstopic.S_MORELINK}</span></div> </td> <!-- IF $LEFT_ARTICLE --> <!-- DEFINE $LEFT_ARTICLE = false --> <!-- ELSE --> </tr><tr> <!-- DEFINE $LEFT_ARTICLE = true --> <!-- ENDIF --> <!-- END newstopic --> </tr></table>

ps: replace the part of the code in the file with this snip-it. Thank you DJMaze...

pss: IE SUCKS this only works with FoxFire (netscape). Is there any way to force this to work with IE?

Gerald Scott
Asheville, NC US

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
. . . . . . . . .. . . . . . ( Linux 2.6.9 / 2.2.3 / 5.0.22 / 5.1.6 / 9.1.2.1 )


So, As I have understood this thread, the "Quad Module" doesn't work in Dragonfly. I'm not a coder. Has anyone been able to get more than 1 (2-5) central blocks horizontally in Dragonfly, yet?

stu

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Don\'t know on Virtual Host


I didn't test the following but it should work

Use the following inside the loop
<!-- DEFINE $LEFT_ARTICLE = $LEFT_ARTICLE+1 -->

Then a little further down inside the loop use
<!-- IF $LEFT_ARTICLE % 2 = 0 -->

What does this do?
A % is a 'mod' calculation it's like (x = x-((x / 2) * 2))

Say x = 6 then:
x / 2 = 3
x * 2 = 6
x - 6 = 0

If x = 7 then:
x / 2 = 3.5 = 3
x * 2 = 6
x - 6 = 1

That way you can use something like:
<table> <!-- IF $LEFT_ARTICLE % 3 = 0 --> <tr><td>message</td> <!-- ELSEIF $LEFT_ARTICLE % 3 = 1 --> <td><table><tr><td>message</td> <!-- ELSEIF $LEFT_ARTICLE % 3 = 2 --> <td>message</td></tr></table></td> <!-- ENDIF -->

This will output: ┌─────────────┬─────────────┐ │ │ │ │ │ Article 2 │ │ │ │ │ Article 1 ├─────────────┤ │ │ │ │ │ Article 3 │ │ │ │ └─────────────┴─────────────┘
Shure it's not the best method if there are NOT 3, 6, 9, etc. articles but it gives you an idea how powerfull themeing actualy is.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


i was wondering if i could get support on this .. "dual news".. when i have a smaller article beside a larger article the smaller arctile appears in the center of the news .. it look wierd .. how would i make it so all news appears at the top?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows XP/Apache 2.0.52/MySQL 4.0.21/PHP 5.0.2/DragonflyCMS 9.0.6.0/ Mozilla Firefox1.7x IE6 Opera 8.0


Even Number is 2,4,6,8,10 is Best Way to do Dual News. If you put odd number then you break math operation of the loop. we should drop odd number to make dual news better so loop can do put news side by side.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


I'm beginning to work on this again and am looking on at the development of the Pro News module with big interest.

However, although I see the logic in what DJMaze has said above, I just can't get it to work, I've tried a few different variations and nothing seems to work.

With the themeing system on DF being so vastly different to the other major CMSs available, I feel it'd be helpful if there was detailed documentation such as what DJMaze has provided above so that virtually anyone with any kind of coding knowledge could start designing different themes so that DF can move away from the standard three column design that, in my opinion, is holding it back slightly.

If someone could apply what DJMaze posted above to a working example that I cold copy and paste onto my test site and work from to try and create some different and interesting theme behaviours I'd be most grateful. Very Happy

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


t3los figured out how to to have dual columns if that is what you are looking for.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x


No that's not what I'm looking for, I can manage to do that just fine.

However, as I explained earlier in the thread I was looking into making a theme that did the following:

Story 1
Story 2 - Story 3
Story 4 - Story 5

And so on.

However, I would also be interested in looking into something that defines clear differences between the top story and the bottom few. Similar to what can be seen on this page would be near to what I'd be looking for in that respect. Skysports

As you can see on that page, the first story has a large thumbnail next to it and is more prominant on the page with more information next to it, but the next few stories are simple one-liners with less prominance to them.

Perhaps I'm being a pain by trying to do this so publicly but the reason for me doing this is often when I find out how to do things through searching the forums and if my attempts to see how much the DF themeing system can really do help even just one other person in the community, then I'm happy. Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 2.0.50/MySQL 4.0.18 /PHP 4.3.9/CPG 8.2b


I tried the code that Gerald had most recently posted and it worked in both IE7 and firefox. Trying to edit the code to blend in with my theme but not having any luck.

Any suggestions at which points I should put the additional codes.
Here is my original code. Any suggestions would be gratefull.

<!-- BEGIN newstopic --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div class="cell_wrapper"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="cell_header"> {newstopic.S_TITLE} </td> </tr> <tr> <td class="cell_content"> <a href="{newstopic.U_NEWTOPIC}"> <img style="padding-left:10px; padding-bottom:10px;" src="{newstopic.IMG_TOPIC}" alt="{newstopic.S_TOPIC}" border="0" align="right" /> </a> {newstopic.S_STORY} <!-- IF newstopic.S_NOTES --> <br /><br /> <b>{newstopic.S_NOTE}</b> <i>{newstopic.S_NOTES}</i> <!-- ENDIF --> </td> </tr> <tr> <td class="cell_info"> {newstopic.S_MORELINK} {newstopic.S_READS} </td> </tr> <tr> <td class="cell_footer"> {newstopic.S_POSTEDBY} {newstopic.S_INFORMANT} {newstopic.S_ON} {newstopic.S_TIME} </td> </tr> </table> </div> </td> </tr> </table> <!-- END newstopic -->

Thanks
Jerry

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
GPGNuke 9.0.6.1

All times are UTC