- Practical Plone 3: A Beginner's Guide to Building Powerful Websites
- Alex Clark Clayton Parker Darci Hanning
- 1181字
- 2021-04-25 17:34:12
News items
As you have seen, Plone sites have built-in sections called portlets, which display short listings of additional content. The news items that we will create will take advantage of this concept. Once your news item has been created and published, it will be available to the users of your site, directly from the portlet. By clicking on the item listed in the portlet, the user is taken to the full news item.

Creating a news item
You can create news items from anywhere that the site administrator has enabled this capability. You can find out if this is the case by clicking on the Add new… link and seeing if the option News Item is available in the drop-down list, as shown in the following screenshot:

After you choose the News Item option, you are taken to the following page, to create the item:

This will look the same as you saw in the chapter on creating pages. Just as with pages, you must provide a Title, and you should also add a Description for your news item. The Description field will be helpful to your site visitors, because once your news item is available, moving the mouse over the news headline in the portlet will show the description text, as shown in the following screenshot:

The body text can be created using the graphical HTML editor, and the HTML editing functionality that you learned in Chapter 4 is available to you. Formatting and linking your News Item is exactly the same as for page creation.
Unlike pages, news items also include fields for a related image and a caption:

When a user clicks on the main News navigation tab, they will see a listing of all of the news items. Clicking on (for example) Plone Conference in Italy takes the user directly to this page within the site. The following screenshot is an example of what a news item looks like when displayed within the news section. By default, Plone also makes this content available via a RSS feed, or you can send a news item to someone via an email message.

When the user clicks on the Read More… link he or she will be taken to the full article:

As you can see, the item itself is very similar to a regular page, with the exception that an image that is included. The image itself can actually be larger in size than the size shown on the page. The user can click on the image to view the image actual size. Plone dynamically resizes the image to better fit it within the context of the article. However it is always a good idea to resize your images before uploading them to your site.
If you have editing (or more powerful) rights to the news item, you can revisit and edit the news page, as well as look at any revisions that have been made it it (by yourself or by other users). If necessary, you can revert the news item to a previous version from the history section.

The History section shown in the preceding screenshot is available for all content items created by you or by others. This functionality is covered in more detail in Chapter 7. This functionality is especially helpful when more than one person is collaborating on a piece of content.
In the default setup of Plone, one of the navigation tabs is News. The News folder contains a default Collection item, which automatically generates a listing of news items located anywhere on your site.
Collections will be covered in more detail in Chapter 6.

While you are in the News section, if you look at the Add new… drop-down option, you will see that the default is to have only News Item available for posting in this section.

The RSS feed link is an available option for allowing visitors to subscribe to the News section of your site. Without any coding on your part, News content is RSS enabled! Users of your site can stay up-to-date as and when new content is added.
The following screenshot shows what it looks like when you subscribe to the news section in Firefox 2.x:

Events
Events are another basic content type in Plone, and share many of the same basic fields as news items and pages.
A default Plone site has an Events folder. Similar to the News folder discussed above, this contains a collection that lists all of the events created within the site.
To add an event within the Events section, click on Add new… and choose Event from the drop-down list.

As noted in the tool tip, Event items are linked to the Calendar Portlet.
The following is a list of fields within the Event content type that are different from what we have seen so far for pages and news items:
- Event Location: Adding content in this section can assist your search engine, and give more context to your event.
- Event Starts (Mandatory): Events are meant to have a beginning and ending time and date.
- Event Ends (Mandatory): See Event Starts (Mandatory), above.
- Attendees: This can be helpful for showing who is participating. The search engine can also pick up on names entered here.
- Event Types
- Existing Categories: This gives you the ability to add keywords that can be used for site collection criteria
- New Categories: Use this if you need to include the existing categories
- Event URL: Link to additional information.
- Contact Name
- Contact E-mail
- Contact Phone
The following screenshot shows how the fields are presented within Plone:

After the section for the event body text, you will see the following fields:

As noted above, apart from the Title, only the start and end dates of the event are mandatory. Plone lets the editor decide if any of the other items that are typically associated with an event should be filled out.
The following is an example of an event that has been filled out with all options complete:

Most of what is shown in the preceding screenshot is self-explanatory, with the exception of the What option, which can be specified via the Categories tab.
Handy, out of the box features include the ability to import a calendar item into either an Apple iCal calendar or Microsoft Outlook. You can also send a link to this page to someone via email, or print the event details:

When you click on the vCal icon or link, you get the following pop up (in Firefox):

You can choose to either open this file, or save it to disk. On choosing Open, or on double-clicking after downloading, the file opens in an Outlook form. You can make additional edits to the event details, or just save it to your calendar.

After saving the event, it is added to your Outlook calendar.
The same type of functionality is available to users of Apple-based computers who use the Apple Calendar, when the iCal option is selected.
- Celtx: Open Source Screenwriting Beginner's Guide
- Yii 1.1 Application Development Cookbook
- DWR Java AJAX Applications
- CorelDRAW X5實用教程(第2版)
- ADOBE FLASH PROFESSIONAL CS6 標準培訓教材
- Instant MuseScore
- OpenCart 1.4 Template Design Cookbook
- Unity 2020游戲開發快速上手
- Autodesk Ecotect Analysis綠色建筑分析應用
- Building Websites with VB.NET and DotNetNuke 4
- 零基礎攝影后期修圖 Photoshop照片處理輕松入門
- AI繪畫與攝影實戰108招:ChatGPT+Midjourney+文心一格
- 計算機圖形制作CorelDRAW X6項目教程
- Jasmine JavaScript Testing
- 新手學Flash CS6動畫制作