Fork me on GitHub

Block Dev HOWTO?  Bottom

Go to page 1 - 2 - 3 [+1]:

  • I have been looking around the site, but havent seen any documentation on how to make a standalone block. Also if i was wanting to make a simple one that just had a PHP script in it, how would i go about that. Sometimes the script is just a little to complex to be posted in a form for the PHP blocks.

    EDIT: Im talking about a standalone block. Not one that is associated with any module.
  • There is no HOW TO at all on block development? The sad thing is that I know how to make a basic module too, but never attempted to make a block.

    All I want to do is put PHP in the block. So basically when I would add the block, it woudl really have no config area at all. It would just be activated. As the logic would all be hardcoded into it.
  • Yeah, I've been a module developer for awhile and recently had to write a block. I was disappointed that there was no doc that I could find. Furthermore, the core PN blocks in CVS are *NOT* API-compliant, which is especially troublesome because it's clear that the dev team doesn't really understand blocks either.

    I have written blocks for the statistics and RSSdisplay modules that I believe are pnAPI compliant. (They're available on http://www.mtrad.com.) You can use them as examples. If you put the block into the includes/blocks directory, you have to use a different function naming convention than when they're in modules. But other than that, it's pretty much the same.

    If you have questions, drop me an email to crsATmtradDOTcom and I'll see what I can do to help.
  • is there still no documentation on this?
  • I have written a couple for the projects I am working on the first.php in the example does a pretty decent job at showing how to do it. the Example first.php is API compliant and uses Smarty templating.
  • Merxion

    I have written a couple for the projects I am working on the first.php in the example does a pretty decent job at showing how to do it. the Example first.php is API compliant and uses Smarty templating.

    i think module blocks run different from stand-alone
  • Oh never saw a standalone block API compliant that is hehe.

    If I had to do one i'd probably build a blank module with whatever user apis necessary in pnuserapi and put the block in the pnblock directory. Wouldn't you want to do this anyway to keep its code seperate from base code?
  • We can do this for you ..

    Ask us for the quote

    http://netpowersoft.com
    http://tradealoan.com
    http://netwallpapers.com
  • wow, this guy is going to get annoying quick
  • MACscr

    wow, this guy is going to get annoying quick


    Noted by moderators.
  • netpowersoft, instead of copy/pasting adverts on the forum, please offer your services at PostNukePro.com.

    Let's work together to keep forum posts informative in nature and not spammy! ;)

    Thanks,

    Alar
  • Has anyone found any documentation as to how to make a standalone block?

    --
    WIRE SERVICE

    Free Press Releases
  • I don't think there is a such thing as a pnAPI compliant standalone block is there? From what I've seen, you need to put the block in a module, even if all you are building is the block. You don't have to have a user or admin interface for it. I think the PN-Teamspeak module is like this. It's just a block, but it installs like a module.
  • hmm, what about for .8 (i know this is late in the game), but /includes/blocks/core/ for core blocks and /includes/blocks/custom or somethign like that for third party blocks. The more seperate third party anything can be, the better IMHO.
  • In .8, the core blocks are now located in /system/blocks/pnblocks Which pretty much reenforces what Jbirchett said, create a module with API functions only.

    --
    Home Page | Find on Facebook | Follow on Twitter

Go to page 1 - 2 - 3 [+1]:

  • 0 users

This list is based on users active over the last 60 minutes.