Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New Plugin - CustomFields
#26
Hmm I've double checked that I'm using the latest release of both GS and the customfield plugin but when I define a dropdown the select doesn't have any options

using this xml

<channel>
<item>
<desc>pagetype</desc>
<label>Cluster Type</label>
<type>dropdown</type>
one
two
three
</item>
</channel>
Reply
#27
Hi sauldraws,
you must put the dropdown so:
Code:
<item>
    <desc>pagetype</desc>
    <label>Cluster Type</label>
    <type>dropdown</type>
        <option>one</option>
        <option>two</option>
        <option>three</option>
</item>
Reply
#28
Yes sorry , the syntax formatter on my site is removing the <option> tags for some reason.

Mike. .
My Github Repos: Github
Website: DigiMute
Reply
#29
I think a better way to record the data, is as follows:

Code:
function saveTagValues(){
    global $tags;
    global $note;
    global $xml;

    while (list($key, $val) = each($tags)) {
        if(isset($_POST['post-'.strtolower($key)])) {
            $note = $xml->addChild(strtolower($key));
            $note->addCData(htmlentities($_POST['post-'.strtolower($key)], ENT_QUOTES, 'UTF-8'));
        }
    }
}

Is it more compatible with special characters, of this way?, or how should this be?

Regards.
Reply
#30
n00dles101 Wrote:Yes sorry , the syntax formatter on my site is removing the <option> tags for some reason.

Mike. .


Awesome - thanks so much...
Reply
#31
K, below is mine solution to add editable window with ckeditor to customfield plugin.

1. copy and paste below code to customfields.php in createTagInputs() function.
I recommend to add it in line 131 or 136
Code:
// draw a textarea window
            case "textarea":
                echo "<td colspan='2'>";
                echo "<script type=\"text/javascript\" src=\"../admin/template/js/ckeditor/ckeditor.js\"></script>".PHP_EOL;
                echo "<b>".$tags[$key]['label'].":</b><br />".PHP_EOL;
                echo "<textarea id=\"post-".strtolower($key)."\" name=\"post-".strtolower($key)."\" >";
                echo stripslashes($data_edit->$key);
                echo "</textarea></td>".PHP_EOL;

                echo "<script type=\"text/javascript\">
                CKEDITOR.replace( 'post-".strtolower($key)."',{
                skin : 'getsimple',
                forcePasteAsPlainText : true,
                entities : true,
                uiColor : '#ECECEC',
                toolbar : [['Bold', 'Italic', 'Underline', 'NumberedList', 'BulletedList', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','Outdent','Indent', 'TextColor','Link', 'Unlink', 'Image'] , '/', ['Format', 'FontSize','RemoveFormat', 'Source']]
        });
            </script>";
            break;

You can add your own buttons to toolbar if you need them.

2. add to data/other/customfields.xml new item with textarea type
example
Code:
<item>
<desc>textareacontent</desc>
<label>Editable content</label>
<type>textarea</type>
</item>

3. edit /admin/edit.php
in line 245 delete: class="set-example-text"
delete line 281: <script type="text/javascript" src="template/js/ckeditor/ckeditor.js"></script>
You have to do this, otherwise both ckeditor instances will interfere with each other and won't work correctly.

4. edit admin/template/js/ckeditor/config.js and add 2 directives:
Code:
config.removePlugins = 'elementspath';
config.resize_enabled = false;

note: above options disable showing currently edited element inside ckeditor.

5. call the textarea content as described by Mike in installation notes
Code:
getCustomField('textareacontent');



known "bugs":
- customfield's ckeditor seems not to use getsimple skin, so it doesn't look like getsimple's ckeditor instance. I have no more willingness to mess with it. If there's a simple way to make it use getsimple's skin, I'll gladly see a hint Wink
- simple image gallery won't work inside content added using this plugin. It's a matter of SIG plugin, not customfields.


have fun
Addons: blue business theme, Online Visitors, Notepad
Reply
#32
Hi everybody, this is my first post.

First, I have to thank Chris for this wonderfull CMS. I am totally amazed for it's simplicity and performance. I am preparing a test project in localhost and works like a charm.

Then comes the great Mike's job with this CustomFields Plugin wich comes soo handy.

Only one thing would be great, to add. A third type of tag: checkboxes.

Let's say we managed to make a news section and want the site owner to simply mark several predefined categories for the news he posts. Right now is not that simple, the owner could mispell those names as he writes them on a textarea.

In example

Code:
<item>
  <desc>newsCategories</desc>
  <label>Valid Categories</label>
  <type>checkbox</type>
  <option>General</option>
  <option>Technology</option>
  <option>Entertainment</option>
  </option>Sports</option>
  <option>........</option>
</item>

So site's owner just need to select one or more checkboxes to assign the page to them.

I'm not that good to php, but will try to figure out how to do that to help. But you, Mike, are far more skilled and maybe could have the time to add this feature?
Reply
#33
new version will be released very soon with added checkboxes, radio buttons, textareas and datepicker fields.

watch this space...

Mike.
My Github Repos: Github
Website: DigiMute
Reply
#34
n00dles101 Wrote:new version will be released very soon with added checkboxes, radio buttons, textareas and datepicker fields.

watch this space...

Mike.
Awesome Mike, thank you for so quick response... you da man!
Reply
#35
Hi, i have installed and not work. Custom field is saved but getCustomField not work and not return any value from xml page.
I don't understand why...

Regards
Reply
#36
Oh sweet, a new CustomFields is in the works. I just came to say I needed to add stripslashes() in a few places in customfields.php so that double quotes etc. would be OK to use.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
#37
hi there i was wondering if the links for download of this plugin in broken couse it it`s working than either i`m to tired or to stupid to download it.
Reply
#38
Yup, your right, url was incorrect, I changed my site recently....

Thks for that..would never have noticed...

M
My Github Repos: Github
Website: DigiMute
Reply
#39
Another textarea - is this part of the next version?
Reply
#40
Yes,it will be there. On vacation at the mo
Should have it finished by the end of the month...
My Github Repos: Github
Website: DigiMute
Reply
#41
hello,

your plugin works with the 2.03 version?
Reply
#42
Yes current version works fine with 2.0x

I'm rewriting the plugin at the moment.
Should be released very soon....
My Github Repos: Github
Website: DigiMute
Reply
#43
hi there, I'm using your plugin and I have a little problem, when putting this ' in the field, in the rendered page we get \' as a result... any ideas on how to solve this? thanks!
Reply
#44
n00dles101 Wrote:Yes current version works fine with 2.0x

I'm rewriting the plugin at the moment.
Should be released very soon....

Hello,

do you have release your latest version of your plugin?
Reply
#45
Hi,

Work and family have kept me too busy for the last little while.

I will release what I have done over the next week or so.

Mike
My Github Repos: Github
Website: DigiMute
Reply
#46
hi mike, no ideas about my problem with ' turning into /' ?
Reply
#47
I love this idea for a plugin - it adds some key functionality I've needed in GS for ages.

However... where's the Download link? I've been all over the plugin page and there's no download source, just how to use it.

Thanks!
Reply
#48
hi origin,

having some problem with my site since I got hacked a couple of weeks ago.

latest version is always available on Extend.

http://get-simple.info/extend/plugin/customfields/22/

Mike.
My Github Repos: Github
Website: DigiMute
Reply
#49
Very good. Thanks so much Mike!

-
Derek
Reply
#50
I just wanted to come back on and say, Mike, this plugin is awesome.

Many, many thanks for giving me the functionality to keep using GetSimple for more projects. I'm in your debt.
Reply




Users browsing this thread: 2 Guest(s)