Jump to content

Add an Add Record button in feed block


bradl

Recommended Posts

I havent tested but this is this is the add record link i took it out from default templates so give it a try it should work :)

<a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="{$category->url()->setQueryString( array( 'do' => 'form', 'd' => \IPS\cms\Databases\Dispatcher::i()->databaseId ) )}">{lang="cms_add_new_record_button" sprintf="\IPS\cms\Databases::load( $category->database_id )->recordWord( 1 )"}</a>

 

Link to comment
Share on other sites

I did try extracting the code from listing and article templates where the button shows, but if moved to a block it breaks the plugin (preview goes blank). I think there is additional context missing to allow the snippet to do its thing. Appreciate the idea though.

Link to comment
Share on other sites

3 hours ago, bradl said:

I did try extracting the code from listing and article templates where the button shows, but if moved to a block it breaks the plugin (preview goes blank). I think there is additional context missing to allow the snippet to do its thing.

I think it's that the code makes reference to variables tied to the database. When used within the proper database templates, it knows what the database and its properties are. But when you move it to a block, it no longer has that assigned variable from which to pull its information.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...