1 kimberly Jun 13, 2012 05:18
3 kimberly Jun 13, 2012 16:26
Thanks Sam for your answer. However, that is not quite what I want to do.
I want to create a new post type and then create the code used to process that new post type. I have searched through the b2evo scripts but having trouble locating the bits and pieces that handle processing the post types when you publish an article.
See, when you publish an article that has post type page, the b2evolution scripts checks the post type to know what it should do with the article. I want to work off the Page post type since there is no real data on creating your own post type, I can learn by examining the b2evolution code. So if you or someone else can tell me where to look for this, then it could save me hours of searching through the b2evolution scripts and that time can be used for writing code.
Thank you
4 kimberly Jun 13, 2012 17:16
OK, it just occurred to me that I am misunderstanding post-types. Each article I write is stored in the database the same way, but the post type field is set to different values.
Then at the time the page is rendered to the viewer is when the post type comes into play.
So my question is where is the code that handles the post types when the article is viewed?
5 sam2kb Jun 13, 2012 17:57
So my question is where is the code that handles the post types when the article is viewed?
I wrote it above :)
Here's a more detailed example, edit /skins/evopress/_item_block.inc.php
<?php
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', $params );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_content.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
?>
<?php
if( $Item->ptyp_ID == 888 )
{
echo 'You are viewing post type 888';
}
else
{ // Display regular content for all other post types
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', $params );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_content.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
}
?>
Here's how you can find post type
You can also add a Universal Item list widget to the Menu container, select your custom post type and then "Link titles" -> "Nowhere"