Help - Search - Members - Calendar
Full Version: Importing entries from a photoblog
Movable Type Community Forum > Additional Resources > Tips and Tricks
shiden4
My photoblog doesn't get much attention, due in part to the fact that no one really knows it exists as part of my blog. I was thinking of setting up a new template with the last 5 entries in my photoblog, and using a PHP include to add them to the sidebar of my main blog installed at the root of my site. However, I came across a few hitches...

There are photos in the entries, which would look unsightly, stretching out the sidebar.

The text, even though minimal, is still a bit much at times for a side bar.

So far I have no idea how to make these entries into links back to the photoblog.

Right now all I've done is setup a new template which has the last 5 entries in my photoblog. I know there is an MT tag that generates an excerpt of an entry, and you can define the number of words, ex: but I can't seem to find it. As far as linking back goes, I think I could put the entry into the href="" part of the permanent link generator. I'm totally clueless about stripping the images though huh.gif
shiden4
I figured out a solution by tinkering around.

I read some where about a tag called and decided to take advantage of this tag since I don't use it for my photoblog entries. The auto-generated excerpt is 20 words long, which is just about perfect for what I intended.

I then made a new .php template (photologentries.php) with and any formatting (CSS etc..), to make the link I wrapped the MTExcerpt tag with a link, and used MTPermaLink to generate the URL. I'm a stickler for title's so I added MTEntryTitle to generate the mouse-over title.

Here's the code for the template:

CODE
<a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>"><$MTEntryExcerpt$></a>


Since I'm using .php to archive my templates, I could easilly include photologentries.php using a PHP include in my main blog easily.

CODE
<? include("photolog/recentphotos.php") ?>


End result is here. I hope someone else can find this information useful smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.