NewsListing
#16
Posted 11 December 2004 - 10:12 AM
I think some people have referred to it as 'paging'
Anyway, what I would like to is to have a page of short descriptions which contain links in news style boxes and at the bottom of that page have a single clickable link to the next set of descriptions / posts /articles or what ever you want to call them.
I have had a look at NewsListing and I like the way it formats the boxes with the title etc and I can specify how many I want on a page - but the one thing I need it to do eludes me because I am not a coder and no little about PHP or JS or CSS.
I can however follow instructions carefully and think *some* things through for myself. I know what I want and have looked long and hard at the examples in the existing scripts like NewsListing but cant quite figure out how to achieve this.
Jaredc and Rad have kindly helped out but I feel I am pestering them with this.
So, I was wondering if anyone out there has this type of scenario already figured out / working who would like to share their snippet with me ?
I guess it woudl need some kind of variable to hold the total number of items with their ID's, then to display N number of them and to generate addditional 'pages' with links. This sounds quite complicated from a non programmer viewpoint and I have no problem with using a workaround that comes close.
Any advice / ideas appreciated !
#17
Posted 11 December 2004 - 10:48 AM
The only thing I need to change in NewsListing is that it shows the SubFolders of the folder it is in. How can I stop it doing this and to only show Documents ?
Thanks !
Edt: AND show a clickable link to the next Subfolder at the bottom of the N number of blogs ?
Just been reading the docs on data retrieval and noted the following :
mixed $etomite->getAllChildren(int $id, string $sortField, string $sortDir[, string $fields]);
This function is the same as the previous function, except all documents are returned, be they published/ deleted or not. Returns FALSE on failure.
and this on document variables ;
isfolder : Integer; true (1) if the document is a folder and false (0) if it is not.
looking at other examples I can see that adding isfolder to this line in NewsListing
will get me a 0 or 1, then I have filter out all but docs . . .
$resource = $etomite->getAllChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby, isfolder');
Now my head hurts . . a little help anyone ?
#18
Posted 20 December 2004 - 10:18 PM
I have now spent at least 4 hours to find the error - and my head starts soon spinning..
I've got some great help in here to correct some other snippets so they can validate 100% to the W3C-standards.
The W3C-link to see my errors
#19
Posted 20 December 2004 - 10:43 PM
espersen, on Dec 20 2004, 11:18 PM, said:
I have now spent at least 4 hours to find the error - and my head starts soon spinning..
here's the link to the snippet library. I suggest you should try it and see if that's what you need http://www.etomite.com/browsesnippets.html...&lst_category=0
#20
Posted 20 December 2004 - 11:04 PM
espersen, on Dec 20 2004, 06:18 PM, said:
I have now spent at least 4 hours to find the error - and my head starts soon spinning..
I've got some great help in here to correct some other snippets so they can validate 100% to the W3C-standards.
The W3C-link to see my errors
Quote
<legend>
Ændrede flyttegebyrer for pensionsordninger
</legend>
<p>En række pensionsselskaber har netop sænket deres flyttegebyrer for de individuelle pensionsordninger, hvormed pensionsopsparerne ikke længere er stavnsbundet pga. de til tider meget store flytteomkostninger...<br />
<a href='index.php?id=43'>More on this subject></a><br />
<div style='text-align:right;'>
Publiceret den 20-12-04 10:19:17
</div>
</fieldset>
#21
Posted 21 December 2004 - 07:32 AM
In stead I've stopped the p with a </p> right before the a-ref - but the output gets a little long..
here's the a part of the snippetcode - where it all is generated.
// strip the content
if(strlen($resource[$x]['content'])>$lentoshow) {
$rest = substr($resource[$x]['content'], 0, $lentoshow);
$rest .= "...<br /> </p> <a href='index.php?id=".$resource[$x]['id']."'>More on this subject></a>";
} else {
$rest = $resource[$x]['content'];
}
$output .= "<fieldset><legend>".$resource[$x]['pagetitle']."</legend>".$rest."<br /><div style='text-align:right;'>Publiceret den ".strftime("%d-%m-%y %H:%M:%S", $resource[$x]['createdon'])."</div></fieldset>";
}
}
}
if($limit>$nrblogs) {
$output .= "<br /><br /><b>Older news</b><br />";
for ($x = $nrblogs; $x < $limit; $x++) {
$output .= "> <a href='[~".$resource[$x]['id']."~]'/>".$resource[$x]['pagetitle']."</a><br />";
}
}
return $output;
#22
Posted 21 December 2004 - 08:18 AM
edited : Think I have to do so, if i want to use the RichText / Editor - and think I got to, because more users are supposed to post news - and they aren't familiar with any codes at all
#23 Guest_eko40_*
Posted 21 December 2004 - 08:35 AM
#24
Posted 21 December 2004 - 08:41 AM
Hopes it isn't too hard to see - off course I want to show who really has done all the hard work !
#25 Guest_Alex_*
Posted 27 December 2004 - 10:20 AM
#26
Posted 31 December 2004 - 12:12 PM
In my main menu generation snippet, first I check the Session, if the lang is set there then use it. Then check GET, if the lang is set there use it and set the Session variable to that. If lang is still not set, go with a default and set the Session variable to the default. The only time the Session variable is not set is for the first entry into the site.
Th problem is that the Session is deleted when going off to read a news item. This resets the main menu to the default language.
I checked this by dumping the Session variables in my menu generation snippet. Clicking on the "read more" or "older news" links causes the Session to vanish; even an empty session would show an empty array with print_r($_SESSION)!
Can anyone help with this?
#27
Posted 31 December 2004 - 02:34 PM
sottwell, on Dec 31 2004, 08:12 AM, said:
In my main menu generation snippet, first I check the Session, if the lang is set there then use it. Then check GET, if the lang is set there use it and set the Session variable to that. If lang is still not set, go with a default and set the Session variable to the default. The only time the Session variable is not set is for the first entry into the site.
Th problem is that the Session is deleted when going off to read a news item. This resets the main menu to the default language.
I checked this by dumping the Session variables in my menu generation snippet. Clicking on the "read more" or "older news" links causes the Session to vanish; even an empty session would show an empty array with print_r($_SESSION)!
Can anyone help with this?
#28
Posted 01 January 2005 - 01:59 PM
Everything is fine, the multilanguage scheme I worked up is working, the template I made looks great, after a few tweaks and hacks in the CSS it even looks good in IE/Win.
Now, however, I've got some pages that don't load the content, but only with IE/Win. Even IE/Mac works! Full news articles, and one other very simple page of links, load the template, the menus, and leave the content area blank.
[edit]
Turns out if I "view source" or refresh the page, the content suddenly shows up. What's with IE/Win? I use a Mac, so I don't know that much about it. Except that it's a peice of trash.
#29
Posted 01 January 2005 - 02:26 PM
#30
Posted 01 January 2005 - 04:29 PM
sottwell, on Jan 1 2005, 09:59 AM, said:
#31
Posted 01 January 2005 - 05:06 PM
I finally got fed up with IE/Win, and went back to a table-based layout for my template. Even then it managed to f&*#k it up and I had to hack at the css to make it work right. What a pain.
#32
Posted 05 January 2005 - 08:39 AM
In the page where the [[NewsListing]] tag is found and the short stories are being displayed, the snippet seems to just cut of the text at the given length. It doesn't check for any html tags to be open or not.
I ran into this problem quite soon. The text got cut of where a link (<a href) was still open. This messed up the result.
It might help if the script checked if at the place where the text is being cut of any tags are open, which are being closed later on in the document. This eliminates the need of listing all tags that should be closed. When the source text is correct every tag should get closed as is should.
Unfortunately I don't have a clue how to implement this... Anybody does?
#33
Posted 05 January 2005 - 02:29 PM
miels, on Jan 5 2005, 04:39 AM, said:
In the page where the [[NewsListing]] tag is found and the short stories are being displayed, the snippet seems to just cut of the text at the given length. It doesn't check for any html tags to be open or not.
I ran into this problem quite soon. The text got cut of where a link (<a href) was still open. This messed up the result.
It might help if the script checked if at the place where the text is being cut of any tags are open, which are being closed later on in the document. This eliminates the need of listing all tags that should be closed. When the source text is correct every tag should get closed as is should.
Unfortunately I don't have a clue how to implement this... Anybody does?
#34
Posted 05 January 2005 - 02:45 PM
If you are willing to step away from truncated body text and look at using the description instead, then you have more snippet options available for use.
#35
Posted 05 January 2005 - 03:03 PM
jaredc, on Jan 5 2005, 10:45 AM, said:
If you are willing to step away from truncated body text and look at using the description instead, then you have more snippet options available for use.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users










