Jump to content

Recommended Posts

Posted

I'm building a fieldtype/inputfield to visually select a grid like Bootstrap since it's the first time coding such thing, I'm basing my code in FieldtypeColorPicker since the base structure is the same, a graphical UI helper to finally output a string as value.

The problem is I try to save the value as something like "1,2,3" referencing the index of each column selected but it gets converted as an int value so "1,2,3" becomes "1" if input random text it gets converted as "0".

Here is the code:

https://github.com/carlitoselmago/FieldtypeGridSpace

Here's an screenshot of how it looks

image.png.93e5a080264f8b2c97bb96bcc4bb671d.png

Posted

I tested it, and it look like its working, see my capture :

- columns echo'd on frontend - ok

- debug dumps - ok

Capture.thumb.PNG.c097d4cf57169b23fa43602378c9cb6b.PNG

  • Like 2
Posted

Yes maybe the cache. 

Try to clear the compiled files and your browser cache then refresh the module.

 

Quote

Actually I don't understand how this part works very well

What I did is, downloading your module from Github, installed it, dumped the var with TracyDebugger - which you should install in a hurry - and tada, it seem it worked ??

  • Like 1
Posted

Thanks! Yes i made it for the specific needs of a client website but the idea is to pollish it a bit and publish it in the Processwire repository, I want to add some options like custom amount of cols etc

  • Like 2

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
×
×
  • Create New...