2. Overview
Objective
Learn the basics of the content management system in
ProdigyView and how to manipulate base content.
Requirements
Installed version of ProdigyView with a database
Estimated Time
8 minutes
www.prodigyview.com
3. Follow Along With Code
Example
1. Download a copy of the example code at
www.prodigyview.com/source.
2. Install the system in an environment you feel comfortable
testing in.
3. Proceed to examples/content/BasicContentExample.php
www.prodigyview.com
4. What is Content Management?
One of the features that ProdigyView offers is a built-in cms that
supports all kinds of content including audio, video, file, event
and ecommerce.
Important!
The content management is meant to be a way of quickly
building sites and presenting a proof of concept or
prototypes to stakeholders and decisions makers such as the
CEO, Managers, and Investors.
The cms contains many extra fields that do not make suitable
for a scaled production. If you are going to use the cms in
production, remember to optimize your database.
www.prodigyview.com
5. Base Content
Base content is the parent content for all the other content
types. Whenever you are creating a different content
type, you will be using base content.
Base Content
Audio Video Event E-commerce File
www.prodigyview.com
6. Creating Base Content
Creating base content is relatively easy. It only requires
defining fields and passing them into
PVContent::createContent method.
1. Set the content
arguments in an
array
2. Pass the
arguments into the
createContent
method
3. Return the id of
the content
8. Base Content Fields
In our last example, we only used three fields for creating
content. When using base content, you have access to a variety
of fields that can help you differentiate your content and set
data. Below is a larger data set of fields that can be used.
content_id date_active content_language
content_title date_inactive translate_content
content_description date_created content_approved
parent_content date_modified content_parameters
app_id is_searchable sym_link
owner_id allow_comments content_order
content_meta_tags allow_rating content_access_level
content_meta_description content_active
content_thumbnail content_promoted
content_alias content_permissions
9. Unique Alias
One of the features we skipped over before was the ability
to create a unique content alias. The content alias is a
unique human readable string identifier that can be given
to any content type.
1. Create the unique alias based upon the based text content
2. Set the content alias 3. Create the content
in the args array
10. Searching For Content
Searching for content create is relatively easy. The PV Standard
Search Query is used with PVContent::getContentList() method. This
will return an array of arrays.
1. Search based on the passed arguments
2. Pass args into getContentList() method
3. Returns an array of arrays that
contains the list of content
www.prodigyview.com
11. Iterate Through Array
After we have retrieved out list of data, we can iterate
through it. Each row will be the data associated with a
different content id.
1. Iterate through the list of arrays
2. Get the information associated with each row
www.prodigyview.com
12. Retrieving Content
Next we are going to retrieve content with a variable.
Remember the id of the content that was returned before? We
can use that for retrieving data associated with that id in the
form of an array.
1. The ID of the content
2. The content returned in an array
13. Updating The Content
When the array is returned, is contains all the data
associated with that content id from the database. If we want
to update the content, we change an index in the array and
pass the content back.
1. getContentIDByAlias return the
id of content with the alias
2. Use the id and retrieve
the data associated with
that id
3. Change a value in the content array 4. Pass the array in updateContent
14. Deleting Content
The final action when dealing with content is deleting. To
delete the content, pass in the id of the content you want
to delete into PVContent::deleteContent().
www.prodigyview.com
15. Review
1. Create base content by passing an array of arguments
into PVContent::createContent()
2. PVContent::createContent() will return the id of the
newly generated content
3. Search for content by using the syntax from PV
Standard Search Query and passing those
arguments into PVContent::getContentList()
4. Update content by passing an array of accepted fields
in PVContent::updateContent(). The content_id
must be present for this method to work.
5. Delete content by passing the content_id into
PVContent::deleteContent().
www.prodigyview.com
16. API Reference
For a better understanding of base content, visit the api
by clicking on the link below.
PVContent
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials
www.prodigyview.com