Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-05 03:12:14

saturnflyer
Member
Registered: 2006-01-22
Posts: 40

developing plugin to view details

I’m trying to create a plugin where I view a list of items in the database. I’ve got that down, but I want to be able to click on one of them and view more details.

This isn’t an admin plugin and I’m no expert in php or txp, and I can’t get my head around this. Events and steps don’t apply to non-admin plugins, right?

How can I use a URL such as mysite.com/section/list-of-stuff?id=1234 to view details?

Offline

#2 2006-12-05 21:19:27

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

Re: developing plugin to view details

Easy.

$id = (int) gps('id');

if ($id)
{
	// I want to view details!
}

else
{
	// I want to view the list!
}

I’d recommend you put the listing code and the viewing code into separate functions as well.

Offline

#3 2006-12-12 11:12:35

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

Re: developing plugin to view details

Did this help, saturnflyer?

Offline

#4 2006-12-14 02:21:23

saturnflyer
Member
Registered: 2006-01-22
Posts: 40

Re: developing plugin to view details

Yes! Absolutely.
Sorry for the delayed response. I was pulled away from this project for a while.

Thanks, Mary.

Offline

Board footer

Powered by FluxBB