News tutorial

If you have created additional (non official) documentation or tutorials or something like that please post this here
elsuertudo
Posts: 7
Joined: Tue 10. Jun 2008, 12:19

Re: News tutorial

Post by elsuertudo » Fri 20. Jun 2008, 14:43

After several attempts I finally got it working and then discovered the vid tutorial. I was going to document but I guess that irrelevant now. (Thanks Ben!!!)

I also would like to know how the pagination works. No success so far. If anybody has implemented it, could you let us know please?

Yeah, phpwcms get better and better!


-

User avatar
oeconom
Posts: 337
Joined: Fri 13. May 2005, 09:33
Location: Stuttgart
Contact:

Re: News tutorial

Post by oeconom » Sat 28. Jun 2008, 16:42

Hi Ben,

this really helped me a lot, THANK YOU!

A question remains on all yours 'best practices'...`:
How do I best realize a combination of teaser and news?
I want a news section/category (so far your tutorial is perfect) AND have the most recent news-teasers being shown on the right-hand side ( {RIGHT} ) of my webpage's starting page.

Thanks for you advide, best wishs,
Felix
...alles wird gut!
still alive...
Experimenting with phpwcms and hoping to have time one day to get a site live... :wink:
One Site finished! :P

User avatar
360fusion
Posts: 120
Joined: Wed 30. Aug 2006, 01:15
Location: Yarm, UK
Contact:

Re: News tutorial

Post by 360fusion » Sat 28. Jun 2008, 17:51

Hi,

I have just done this on a site i'm doing, it's on localhost so i can't show you a link but here is the template and the css.

Just add another news content part to your home page and set it to display right {RIGHT} in the content part. then select this template and add the css to frontend.css.

the template has a div tag called: <div id="newsContainer"> you can adapt this to suit your needs.

Save the template as something like: news_list.tmpl in template\inc_cntpart\news

Template:

Code: Select all

<!--NEWS_SETTINGS_START//-->
; how many news should be listed per row
news_per_row = 2

; teaser text rendered as <p></p> = p
; or just line break to <br> = br
news_teaser_text = p

; template for files - the same as used
; for content part files , default:
; files_template_list = default
files_template_list = default
files_template_detail = default
files_direct_download = 0

<!--NEWS_SETTINGS_END//-->
news_per_row = 1

<!--NEWS_LIST_START//-->
[TITLE]<h3>{TITLE}</h3>[/TITLE]
[SUBTITLE]<h4>{SUBTITLE}</h4>[/SUBTITLE]
[NEWS_ENTRIES]{NEWS_ENTRIES}[/NEWS_ENTRIES]
<!--NEWS_LIST_END//-->
<!--NEWS_LIST_ENTRY_START//-->
<div class="newsEntry[PRIO] prio{PRIO}[/PRIO]">
<div id="newsContainer">
<ul>
[NEWS_TITLE]<li><a href="{NEWS_DETAIL_LINK}">{NEWS_TITLE}</a></li>[/NEWS_TITLE]
</ul>
</div>
</div>
<!--NEWS_LIST_ENTRY_END//-->
<!--NEWS_LIST_ENTRY_SPACE_START//-->
	<!-- space between news items -->
<!--NEWS_LIST_ENTRY_SPACE_END//-->
<!--NEWS_LIST_ROW_SPACE_START//-->
	<!-- space between rows of news items -->
<!--NEWS_LIST_ROW_SPACE_END//-->
<!--NEWS_LIST_START//-->
[NEWS_ENTRIES]{NEWS_ENTRIES}[/NEWS_ENTRIES]
<!--NEWS_LIST_END//-->


<!--NEWS_DETAIL_START//-->
<div class="news">
	<!-- 
		Changedate: {DATE:d/m/Y H:i:s lang=EN}
		Livedate: {LIVEDATE:d.m.Y H:i:s lang=EN}
		Killdate: {KILLDATE:d.m.Y H:i:s lang=EN}
	//-->
	[NEWS_TITLE]<h1>{NEWS_TITLE}</h1>[/NEWS_TITLE]
	[NEWS_SUBTITLE]<h2>{NEWS_SUBTITLE}</h2>[/NEWS_SUBTITLE]
	[NEWS_TOPIC]<p>Written on {LIVEDATE:d-m-Y lang=EN} by [AUTHOR]{AUTHOR}[PLACE], {PLACE}[/PLACE][/AUTHOR][AUTHOR_ELSE][PLACE], {PLACE}[/PLACE][/AUTHOR_ELSE]</p>[/NEWS_TOPIC]
	[IMAGE]
		[ZOOM_ELSE]
	[IMAGE_URL]<a href="{IMAGE_URL}"{IMAGE_URL_TARGET}>[/IMAGE_URL]
	<div class="newsImageTeaser"><img src="img/cmsimage.php/150x150x1/{IMAGE_ID}" alt="{CAPTION}" border="0" /></div>[IMAGE_URL]</a>[/IMAGE_URL]
		[/ZOOM_ELSE]
		[ZOOM]
	<a href="img/cmsimage.php/640x480/{IMAGE_ID}" target="_blank"{LIGHTBOX}[LIGHTBOX_CAPTION] title="{LIGHTBOX_CAPTION}"[/LIGHTBOX_CAPTION]>
	<div class="newsImageTeaser"><img src="img/cmsimage.php/200x185x1/{IMAGE_ID}" alt="{CAPTION}" border="0" /></div></a>
		[/ZOOM]		
	[/IMAGE]
	[NEWS_TEXT]<div class="news_text">{NEWS_TEXT}</div>[/NEWS_TEXT]
	[NEWS_TEXT_ELSE][NEWS_TEASER]{NEWS_TEASER}[/NEWS_TEASER][/NEWS_TEXT_ELSE]
	[URL]
		<p><a href="{URL}"{URL_TARGET}>[URL_TEXT]{URL_TEXT}[/URL_TEXT][URL_TEXT_ELSE]more[/URL_TEXT_ELSE]</a></p>
	[/URL]
	[FILES]{FILES}[/FILES]
		[NEWS_LIST_LINK]
		<p class="link"><a href="{NEWS_LIST_LINK}">Back to news section</a></p>
	[/NEWS_LIST_LINK]
</div>
<!--NEWS_DETAIL_END//-->
CSS:

Code: Select all

#newsContainer
{
width: 195px;
margin-top: 0px;
padding: 0px;
font-family: Verdana, Lucida, Geneva, Helvetica, Arial, sans-serif;

color: #333333;
}

#newsContainer ul
{
list-style: none;
margin: 0;
padding: 0;
border: none;
}

#newsContainer li
{
border-bottom: 1px dashed #999999;
margin: 0;

}

#newsContainer li a
{
display: block;
padding: 5px 5px 5px 0px;
background-color: #ffffff;
color: #333333;
text-decoration: none;
width: 180px;
}

html>body #newsContainer li a { width: auto; }

#newsContainer li a:hover
{
background-color: #eeeeee;
color: #333333;
}

#newsContainer li li
{
border-bottom: 1px dashed #999999;
border-bottom: 0;
margin: 0;
}

#newsContainer li li a
{
display: block;
padding: 5px 5px 5px 20px;
background-color: #ffffff;
color: #000000;
text-decoration: none;
width: 180px;
}
#newsContainer li li li
{
border-top: 1px dashed #999999;
border-bottom: 0;
margin: 0;
}

#newsContainer li li li a
{
display: block;
padding: 5px 5px 5px 30px;
background-color: #ffffff;
color: #666666;
text-decoration: none;
width: 160px;
}
Hope this helps
Ben

User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Re: News tutorial

Post by Marceau » Mon 15. Sep 2008, 16:27

Really great.

Thank you Ben !!

Regards...
There are 10 types of people in the world: Those who understand binary and those who don't

User avatar
bogus
Posts: 75
Joined: Tue 18. Jan 2005, 17:36

Re: News tutorial

Post by bogus » Mon 15. Sep 2008, 16:54

VOTE for Sticky this POSTING !!!
Greetings

Bogus

selbaer
Posts: 93
Joined: Sun 22. Jan 2006, 02:19
Location: Florida West Coast

Re: News tutorial

Post by selbaer » Fri 5. Dec 2008, 22:48

I tried, watched your video and everything seems to be idiot proof but ...

When I click on the [more...] link ( TLD.com/index.php?news&newsdetail=19991130-34_news )
I get redirected to the index.phtml.

Any idea what I am missing? PHPWCMS 1.3.9
Last edited by selbaer on Sat 6. Dec 2008, 03:12, edited 1 time in total.

User avatar
Jensensen
Posts: 2995
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: News tutorial

Post by Jensensen » Sat 6. Dec 2008, 02:51

... is not relevant for tut but sup.
anyway, we had this question/answer in DE anywhere, but can't find, ups.

It was around/nearly: Do you have --> target, --> (news)articles assigned?

btw: is alan parsons still alive?
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.

selbaer
Posts: 93
Joined: Sun 22. Jan 2006, 02:19
Location: Florida West Coast

Re: News tutorial

Post by selbaer » Sat 6. Dec 2008, 03:09

Jensensen wrote:
Do you have --> target, --> (news)articles assigned?
where would i do this? can't find any "target" box or line...

does it have anything to do with the [more...]url?

Image

selbaer
Posts: 93
Joined: Sun 22. Jan 2006, 02:19
Location: Florida West Coast

Re: News tutorial

Post by selbaer » Sat 6. Dec 2008, 04:16

Jensensen wrote:
anyway, we had this question/answer in DE anywhere, but can't find, ups.
ja, sieht so aus als ob Kukki das selbe problem hat.
siehe hier: http://forum.phpwcms.org/viewtopic.php?p=110406#p110420

User avatar
Jensensen
Posts: 2995
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: News tutorial

Post by Jensensen » Sat 6. Dec 2008, 04:59

targeting: http://forum.phpwcms.org/viewtopic.php?p=109792#p109792

still searching for the solution of "news-jump-index"...i'm sure it was somewhere...(w?)here...
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.

User avatar
markus s
Moderator
Posts: 654
Joined: Sat 16. Dec 2006, 19:21
Location: Radfeld / Tirol
Contact:

Re: News tutorial

Post by markus s » Sat 6. Dec 2008, 09:33

use this field to link in another site - made with another CP maybe...
if you fill out this field you got a link - thats all...

and if you fill out the field called "URL/text" you change the link name !
if you do not fill out this field, you can see only the "more..." link
moderator
propelled by fresh air from tirol
XING|FACEBOOK|OMENTO

no remorse
Posts: 106
Joined: Tue 17. Jul 2007, 22:13

Re: News tutorial

Post by no remorse » Mon 20. Jul 2009, 21:50

Hello everybody

I have a few questions but my technical English is not very well so I have to ask my questions in German if it's ok.(?)

Ich habe phpwcms 1.4.2. Bin nach der Anleitung gegangen (vielen Dank für das Video-Tutorial). mod_rewrite ist on und funktioniert wunderbar. Jedoch nicht bei den News. Der Teasertext wird zwar angezeigt aber wenn ich auf read klicke, dann kommt die im Admin/Vorlage unter Fehler hinterlegte Meldung, dass die Seite nicht angezeigt werden kann (Fehler 404, hier wird noch gebaut). Der Pfad, wenn ich mit der Maus über den Link read gehe sieht wie folgt aus:

http://localhost/index.php?Neuigkeiten& ... Programm-1

Wo könnte der Hund bei mir begraben sein? Ich bin noch im Anfängerstadium und wäre für leicht verständliche Tipps dankbar.

pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: News tutorial

Post by pepe » Mon 20. Jul 2009, 21:57

Hast du ALLE Kategorien mit ALIAS versehen?
Eine online URL wäre ggf hilfreich... wenn du hast!

no remorse
Posts: 106
Joined: Tue 17. Jul 2007, 22:13

Re: News tutorial

Post by no remorse » Mon 20. Jul 2009, 22:35

Hallo pepe

1.
Ich habe unter Seitenstruktur Neuigkeiten mit dem Alias der Seitenebene neuigkeiten-1 (warum hier -1 automatisch dazugeschrieben wird weiss ich nicht). Unter Artikel habe ich einen Artikel Neuigkeiten mit dem Alias neuigkeiten-2 (wird auch automatisch geschriben). Dann wurde ein CP News angelegt wie im Video (Archich:archiv und Newsartikel: Neuigkeiten).

Dann Artikel>News und zwei News erstellt:
Inhaltstitel: Neu im Programm
Bezeichnung: Neu im Programm und Alias: Neu-im-Programm-1 (auch automatisch)

Frage am Rande: kann es sein, dass, wenn man den Alias ändert, nicht mehr den alten Alias verwenden kann? Wo wird dies in der DB gespeichert wie kann ich die alten Alias löschen?

2.
ich verwende xampp und doktere solange lokal herum bis ich es ein wenig drauf habe. will mich ja im weltweiten Netz nicht blamieren :wink:

User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: News tutorial

Post by flip-flop » Mon 20. Jul 2009, 23:43

Hallo,

ein Alias darf nur ein einziges mal im System vorkommen. Bei der Anlage von Kategorien oder Artikeln gleicht das System die Datenbank ab und ergänzt autom. den Alias mit fortlaufenden Nummern. Groß/Kleinschreibung spielen keine Rolle. Zwischen Kategorie und Artikel wird nicht unterschieden, da beide in der URL gleichberechtigt.
Bsp.:
Vergebener Kategorie-Alias: neuigkeiten
Vorgeschlagener Artikel-Alias: Neuigkeiten-1
Nächster Kategorie-oder Artikel-Alias: NeuigKeiten-2

Siehe auch: Löschen von alten Einträgen in der DB

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )

Post Reply