Jump to content

Inputfield without Fieldtype or db data


Recommended Posts

Hello, just a quick question:

Is it possible to create inputfield without any db data? I'd like to create a field, that would take place in administration, but wouldn't actually have any data; it would just include some Javascript and show shortcuts to run it (read: I need multiple 'default' values and easy way to switch between them)

Hope it makes sense,

Adam

Link to comment
Share on other sites

Well, you technically only need inputfield, since that is responsible on what is shown on admin. But it would feel wrong to use textfield or any other data containing field, so I would probably create corresponding dummy fieldtype also.

Link to comment
Share on other sites

This is an interesting topic. Using fields in the administration without db data

but holding custom js or css that you can call in your webpages.

Apeisa: how do you create an input field with a dummy field type ???

Adamkiss: how did you solve it ?

Link to comment
Share on other sites

I just created JSModule (or ModuleJS), which includes custom JS into the page load, and my Javascript modified the DOM, inserted the correct buttons and set callback for them.

It would be somewhat more elegant, if I had the buttons that do stuff already included as a field, but this works as well, although the hooking code (I am inserting some shortcuts into each item of repeater field) is somewhat ugly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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