panel.jpg Follow us on Twitter and Facebook

/// Blog

March 19, 2013
Category: Development Written by: Tagged: pyrocms pyrostreams

Adding an Image Field to a blog post in PyroCMS

Here is a quick demonstration of the power of PyroCMS for those who are fairly conversant with the PyroCMS architecture. The PyroCMS developers had recently "stream enabled" the Blog Table. This basically means that you can now treat the Blog table as a stream and that gives you all the power and flexibility that comes with any stream created using PyroStreams.

Now, to insert an image in a blog post, I basically added a custom field to the blog stream called "Featured Image".

Create Image Field for Blog Table

Thats it!

Your blog post can now take an image!

To view the image in the output, the blog view needs to be overloaded in the theme.

In the overloaded view, you just add the following code and there you go .... your image is shown in the blog post output!

Display Custom Image Field in Blog Post

Now ain't that cool!

Here is an demo that displays a custom image field in a blog post on PyroCMS.

Hope it was useful ... that was a demonstration of the image in a theme that is yet to be released.

Please support the PyroCMS guys by purchasing their Professional license and contributing to their theme and addon section.

PyroCMS is really neat and quite powerful in many usecases!

/// Our Twitter Feed

Find out what's happening, right now, with the people and organizations you care about.

Twitter
Copyright 2012 MyPad.in