Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-29 04:53:29

MusingQ
New Member
Registered: 2008-01-29
Posts: 1

I'm sure you've heard this one before....

You know it’s been a long time since I’ve actually looked at anything “code related” and felt like a total retard, that was until I decided I’d start a blog and use TextPattern. After spending the last two nights on the verge of throwing things, I had to break and down and register in the forums and finally post.

Is there some sort of SDK-like documentation available for TxP or a site with some good examples on customization. Just basic stuff like having a category listing show up with an article count that’s only showing categories with articles in them and respecting the parent child relationship between categories in display? Ok that doesn’t sound basic, but it seems like a no-brainer to me and I was sort of left scratching my head looking around for examples on how to do similar things.

I’ve found sites that have a lot of plug-ins to do this or that, but although I commend the people who’ve created the plug-ins, I’m really someone that wants to see the code behind it so that I can understand how to put it together myself. I know I know never remake the wheel and all with regards to code-reuse, but I’m always angling to build a better mousetrap.

So… TextPattern seems like a pretty cool blogging tool and if anyone out there can suggest a site or two with some good sample code or explanations on how some of the more elementary customization can be done, I’d whole-heartedly appreciate it.

Thanks in advance,

-Q

Offline

#2 2008-01-29 06:26:33

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: I'm sure you've heard this one before....

Cheers!

Offline

#3 2008-01-29 07:00:51

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: I'm sure you've heard this one before....

Just basic stuff like… examples on how to do similar things.

And quite often, someone else has already asked how to achieve one thing or another, so searching the forum can turn up answers as well.

Offline

#4 2008-01-29 11:15:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: I'm sure you've heard this one before....

If you find a plugin that does what you want, download it and during the install process (before the final step), you can see the plugin code.

Offline

#5 2008-01-29 13:31:19

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: I'm sure you've heard this one before....

MusingQ wrote:

After spending the last two nights on the verge of throwing things …

I started the same way, except the period of baffled frustration was closer to two weeks. But I’m glad I stuck it out. And there’s a lot more (and better) documentation nowadays. I refer to the Textbook tag list all the time.

Just basic stuff like having a category listing show up with an article count that’s only showing categories with articles in them and respecting the parent child relationship between categories in display? Ok that doesn’t sound basic, but it seems like a no-brainer to me …

Textpattern doesn’t store article counts in the category table, so while it seems like a basic thing to ask, this is indeed just the sort of thing that gets left to plugins. For a CMS Textpattern has a very small code base. For better or worse, and I think it’s overwhelmingly for the better, Textpattern’s default functionality has deliberately been kept fast and light. That said, the core functionality does increase from version to version, and a new version is right around the corner.

By the way, I use cbs_category_list to get category lists that only show categories with articles in them. It can also display the article count, and is section-sensitive. However, it doesn’t distinguish between parent and child categories.

I’ve found sites that have a lot of plug-ins to do this or that, but although I commend the people who’ve created the plug-ins, I’m really someone that wants to see the code behind it so that I can understand how to put it together myself. I know I know never remake the wheel and all with regards to code-reuse, but I’m always angling to build a better mousetrap.

As ruud said, you can check the code of any plugin before you install it. Also, you can install a plugin without activating it. Finally, you can also easily modify plugins from within the Textpattern interface, by clicking the edit link in the plugin list.


Code is topiary

Offline

Board footer

Powered by FluxBB