Wordpress Theme utilizing Nette; Form field question

Notice: This thread is very old.
FlawlessVictory
Member | 2
+
0
-

Hey, I am using a premium wordpress theme that utilizes the nette framework. Unfortunately the theme author provides zero support unless its related directly to a default function of the theme – So any kind of modifications, regardless of how small are completely up to the end user to figure out…

Anyway, here is my query:

Its a directory based theme, that has a template for each item/product entered into the directory. On that template, it outputs fields entered through the admin section in Wordpress. These fields includes map location, e-mail, telephone number etc.

Example:

This is how standard text fields are outputted through the template:

File name: dir-item.neon

web:
	label: Website
	type: text
twitter:
	label: Twitter
	type: text
facebook:
	label: Facebook
	type: text

File name: single-alt-dir-item.php

<div class="item-info">

		{if
		(!empty($options['web'])) ||
		(!empty($options['twitter'])) ||
		(!empty($options['facebook']))}

		<dl class="item-address">

			{if (!empty($options['web']))}
			<dt class="web">{__ 'Web:'} </dt>
			<dd class="data"><a href="{!$options['web']}">{!$options['web']}</a></dd>
			{/if}

			{if (!empty($options['twitter']))}
			<dt class="web">{__ 'Twitter:'} </dt>
			<dd class="data"><a href="{!$options['twitter']}">{!$options['twitter']}</a></dd>
			{/if}

			{if (!empty($options['facebook']))}
			<dt class="web">{__ 'Facebook:'} </dt>
			<dd class="data"><a href="{!$options['facebook']}">{!$options['facebook']}</a></dd>
			{/if}



		</dl>
		{/if}

Finally, my query!

How would I go about adding a variety of advanced fields?… I am referring to:

  1. Multi-select box
  2. File upload field
  3. Multi-image select box – Something that would output a gallery of images on the page
  4. Date selector/picker box

Any advice would be appreciated.

petr.pavel
Member | 533
+
0
-

I'm afraid this isn't related to the framework itself, but rather to the logic of the theme / WP support.
Nette is not a visual framework. It doesn't provide shiny form elements like date picker, or image picker.
Nette is set of PHP enhancements and tools for PHP programmers, not HTML designers.

Your template (speaking of “templates” in the sense of Nette, not WP) seems to be in Latte despite the .php extension. For help on Latte see documentation on templating, default macros and default helpers.

You can chose to ignore what Nette offers for forms and use vanilla PHP and HTML. I.e. <input type=“file”>, <select multiple> for the first two. Learning the forms is worth the effort though.

As for the two remaining items, there are many javascript based date pickers, pick any (e.g. from jQueryUI).
I'm not aware of any generic image selector widget.

You will also have to write the PHP part that handles data sent by those widgets. Nette is not a plug'n'play thingy :-) You have to be a PHP programmer.

FlawlessVictory
Member | 2
+
0
-

Thanks Petr, really appreciate the advice.