Jump to content


- - - - -

[Modification] Document Content Variables


  • This topic is locked This topic is locked
118 replies to this topic

#81 Guest_rthrash_*

  • Guests

Posted 10 March 2005 - 04:40 PM

DocVars' author isn't around any more and it's not really supported.

However, it has been significantly improved upon and extended in [DO NOT CIRCUMVENT THE WORD FILTER]2 in the Unofficial Mods forum... take a peek if you get a chance. :)

#82 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 11 March 2005 - 03:04 AM

iamrick, on Mar 10 2005, 12:18 PM, said:

I've run into a small problem with the select box with multiple options. I just get the output: "Array". Have a look here...

Any idea why this is happening?

Also does it have anything to do with why the images are not showing up correctly to the left of it? You'll notice etomite is not pushing [*alias*] out correctly.

Cheers  :D


well... I'm still around but don't use Etomite quite as much. My current projects require intense user management and logic that really goes beyond Etomite capabilities. But I still love Etomite when I need a pure content-only CMS.

What is the "Array" content variable type? In other words, what data type have you selected when you created the variable? It seems to be unique from the other docvars so I would be interested in knowing how it is different.

I didn't see [*alias*]. Is this something that has already been fixed?


Thanks,
JG

#83 iamrick

    Etomite Forum Newbie

  • Member
  • 14 posts

Posted 14 March 2005 - 12:31 AM

apodigm, on Mar 11 2005, 01:04 PM, said:

well... I'm still around but don't use Etomite quite as much.  My current projects require intense user management and logic that really goes beyond Etomite capabilities. But I still love Etomite when I need a pure content-only CMS.

What is the "Array" content variable type? In other words, what data type have you selected when you created the variable? It seems to be unique from the other docvars so I would be interested in knowing how it is different.

I didn't see [*alias*].  Is this something that has already been fixed?
Thanks,
JG

Oh... I didn't realise it wasn't supported anymore :( The [*alias*] problem was fixed, dreamweaver had changed it to a unicode format and I didn't realise (stupid me!). But as you can see the Array problem is still there. The variables for this are things like:

Bank Spillover||Ground Cover||Hanging Baskets||Hedging||Pergolas||Pots & Tubs||Topiary||Screening etc.

#84 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 14 March 2005 - 01:29 AM

iamrick, on Mar 14 2005, 06:31 AM, said:

Oh... I didn't realise it wasn't supported anymore :( The [*alias*] problem was fixed, dreamweaver had changed it to a unicode format and I didn't realise (stupid me!). But as you can see the Array problem is still there. The variables for this are things like:

Bank Spillover||Ground Cover||Hanging Baskets||Hedging||Pergolas||Pots & Tubs||Topiary||Screening etc.

iamrick,

If you wouldn't mind, I think I would need to log into your Etomite manager. You can PM me or send an email to web_at_apodigm.com

#85 bwoodsdesign

    Likes Etomite Forums!

  • Member
  • PipPip
  • 236 posts

Posted 12 May 2005 - 04:56 AM

Been following this thread and it seems like a great mod.

Does anyone here have a live example page of where the docvars was utilized and in which part of the page?

Just curious. I'd like to include something like this in the future on a project I'm doing but I don't want to get in over my head before I decide it's worth my while.

Thanks!

#86 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,507 posts
  • Gender:Male

Posted 12 May 2005 - 05:24 AM

bwoodsdesign, on May 12 2005, 01:56 AM, said:

Been following this thread and it seems like a great mod. 

Does anyone here have a live example page of where the docvars was utilized and in which part of the page? 

Just curious.  I'd like to include something like this in the future on a project I'm doing but I don't want to get in over my head before I decide it's worth my while.

Thanks!
DocVars, which is now part of the [Filtered]2 unofficial mod, is no longer supported on this site... Try doing a web search for [DO NOT CIRCUMVENT THE WORD FILTER]+2 (without plus signs) if you are interested in using that package... Unfortunately, doing so will jeopardize any support on this site which, due to the major amount of core changes, is why the forked project has been moved off-site... :eto:

#87 digitalmouse

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 29 June 2005 - 01:59 PM

greetings! i'm looking for a way to convert a static website to etomite- a website that has a 'left side' and 'right side' to it, separated by some graphics (see http://www.hobbensiefken-rastede.de/ to see what i am dealing with). i *think* DocVars will do what i need, but not 100% sure. my question is so:

using DocVars, can i create [*left-content*] and [*right-content*] placeholders (for example) that can be put in the template, and have different documents be attached to either of those document variables?

again, based on what i've read i would like to think DocVars (or maybe the MOD-x2 that was mentioned in the previous post) can do this, but not 100% sure.

any tips, tricks, and implementation suggestions are greatly appreciated!

:D

#88 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,507 posts
  • Gender:Male

Posted 29 June 2005 - 02:07 PM

digitalmouse, on Jun 29 2005, 10:59 AM, said:

greetings!  i'm looking for a way to convert a static website to etomite- a website that has a 'left side' and 'right side' to it, separated by some graphics (see http://www.hobbensiefken-rastede.de/ to see what i am dealing with).  i *think* DocVars will do what i need, but not 100% sure.  my question is so:

using DocVars, can i create [*left-content*] and [*right-content*] placeholders (for example) that can be put in the template, and have different documents be attached to either of those document variables?

again, based on what i've read i would like to think DocVars (or maybe the MOD-x2 that was mentioned in the previous post) can do this, but not 100% sure.

any tips, tricks, and implementation suggestions are greatly appreciated!

:D
Neither of the packages that you have mentioned are supported on this site any longer but you should be able to do what you want without either of those packages... My best advice would be to work out an appropriate template layout and ask for help when you have specific questions... I'm sure the community would gladly help you through any sticking points... :eto:

#89 digitalmouse

    Etomite Forum Newbie

  • Member
  • 7 posts

Posted 29 June 2005 - 02:21 PM

Ralph (rad14701), on Jun 29 2005, 04:07 PM, said:

Neither of the packages that you have mentioned are supported on this site any longer but you should be able to do what you want without either of those packages... My best advice would be to work out an appropriate template layout and ask for help when you have specific questions... I'm sure the community would gladly help you through any sticking points... :eto:

thought as much- and thanks for the quick reply! i do have a template made already for that website, and i *could* just force the client to use a document with this left-side/right-side format split by a graphic as a 'template-within-a-template' kinda thing (this is my current 'backup plan'), but my thought is that a second [*content*] variable is all i really need. i can then give the client some kind of drop-down ('left-side' etc.) menu in the edit page - something similar to choosing a template - so they can choose which side of the page they want a particular document content to be displayed.

i do believe i am fit enough in PHP to whip up a hack for this myself, but my post is more for a 'shout-out' to see if someone has already done this, or something similar, or those of you who understand the inner workings the best can see the hack(s) needed to complete my request. and i'd rather not re-invent the wheel if at all possible (time is money!).

thanks for your time!

[edit] hmm... maybe the ShowDoc snippet will do the job. (amazing what you find out when you search the forum and snippet library!)

Edited by digitalmouse, 29 June 2005 - 05:24 PM.


#90 jlarson

    Etomite Forum Newbie

  • Member
  • 2 posts

Posted 02 July 2005 - 03:02 AM

Ralph (rad14701), on May 12 2005, 01:24 PM, said:

DocVars, which is now part of the [Filtered]2 unofficial mod, is no longer supported on this site... Try doing a web search for [DO NOT CIRCUMVENT THE WORD FILTER]+2 (without plus signs) if you are interested in using that package... Unfortunately, doing so will jeopardize any support on this site which, due to the major amount of core changes, is why the forked project has been moved off-site... :eto:
You might find it easier if you search for just [DO NOT CIRCUMVENT THE WORD FILTER] (without plus signs).

#91 ceaza

    Etomite Forum Newbie

  • Member
  • 27 posts

Posted 14 September 2005 - 05:47 PM

Thanks again for a great script

When I use the checkbox or select-multiple options I get "ARRAY" where the Content Variable is called.

My Code is:
Name [[WhichMenus]]
Field type: checkbox
Field Elements : {{none}}||{{Menu1}}||{{Menu2}}||{{Menu3}} (all calling chunks)

I call [*WhichMenus*]

If I just check 1 it works, but if I check more that 1 I get the error.

I use the following types in the pages with no problems:
Text, HTML, Radio

Please can you help.

ceaza

Edited by ceaza, 14 September 2005 - 05:47 PM.


#92 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 September 2005 - 04:11 AM

ceaza, on Sep 15 2005, 12:47 AM, said:

When I use the checkbox or select-multiple options I get "ARRAY" where the Content Variable is called.

If I just check 1 it works, but if I check more that 1 I get the error.

I'm sure there is a fix in the PHP code, but not having looked at that for nearly a year, I'm hesitant to even pull it up.

Here's a possible work around...
create three DocVar fields:
[*ShowMenu1*]
[*ShowMenu2*]
[*ShowMenu3*]

Each one can be a checkbox docvar with only one element in each. for example:
[[ShowMenu1]]
type: checkbox
element: {{Menu1}}

(the state of off or on will determine whether the element is displayed or not.)


... anyway... like I said, this could be solved with a little PHP.

you may want to check this in the root /index.php (mine it's around line 719):
//need to split array
$docvars[$docvar_row['field_name']] = explode("||", $docvar_row['field_value']);

possibly change that to avoid creation of an array type (which is what you see when the page gets rendered). Since the arrays really haven't been utilized, in your case you can just change that line to this:
//need to split array
$docvars[$docvar_row['field_name']] = str_replace ("||","", $docvar_row['field_value']);


If that doesn't work, then you might try this..
/manager/processors/save_content.processor.php

you need to find this code (it's around line 179 in my version):

Quote

    // deal with checkboxes & multiple selects elements
    $feature_insert = "";
    while (list($featureValue, $feature_item) = each ($_POST[$row['field_name']]))
    {
  $feature_insert = "$feature_insert||$feature_item";
    } // end while

    // now remove the first two characters
    $feature_insert_length = strlen($feature_insert);
    $feature_insert_length = $feature_insert_length - 2;
    $feature_insert = substr($feature_insert, 2, $feature_insert_length);
                                                            $docvars[$row['field_name']] = $feature_insert;


I think this needs to be modified to something more like this:

Quote

    // deal with checkboxes & multiple selects elements
    $feature_insert = "";
                                                                foreach($_POST[$row['field_name']] as $key => $value){
  $feature_insert .= "||" . $value;
    } // end while

    // now remove the first two characters
    $feature_insert_length = strlen($feature_insert);
    $feature_insert_length = $feature_insert_length - 2;
    $feature_insert = substr($feature_insert, 2, $feature_insert_length);
                                                            $docvars[$row['field_name']] = $feature_insert;


#93 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 15 September 2005 - 06:52 AM

I was just wondering if you apodigm, or anyone else, would wish to review this snippet / mod and see if there is any upgrading that can be done for 0.6.1 ?

#94 ceaza

    Etomite Forum Newbie

  • Member
  • 27 posts

Posted 15 September 2005 - 01:02 PM

Wow Thanks

Quote

you may want to check this in the root /index.php (mine it's around line 719):
//need to split array
$docvars[$docvar_row['field_name']] = explode("||", $docvar_row['field_value']);

possibly change that to avoid creation of an array type (which is what you see when the page gets rendered). Since the arrays really haven't been utilized, in your case you can just change that line to this:
//need to split array
$docvars[$docvar_row['field_name']] = str_replace ("||","", $docvar_row['field_value']);
Fixed the problem

I chose this route rather than seperate DocVars for each due to the fact the you have to edit and reload each page that uses the template, if you have a way around that I would appreciate it.

Quote

DEAN Wrote I was just wondering if you apodigm, or anyone else, would wish to review this snippet / mod and see if there is any upgrading that can be done for 0.6.1 ?

I really would like to help but I am not great with coding, I would highly reccomend this in you next releases.

Once again guys you for such a cool CMS and all the mods that make it the only CMS to work with.

#95 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 September 2005 - 02:33 PM

Dean,

I basically created this project years ago and rarely even look at it anymore. In fact I didn't know that E 0.6.1 was out until you mentioned it. :)

Ryan Thrash has a developer working on a fork of Etomite that includes a heavily modified DocVars in it. I think there are some other contributions embedded, and new features, but I haven't seen it. you can look through this forum for more information on his project.

If anyone wants to take DocVars and make it compatible with the new Etomite, I am happy to hand off. In fact the open source nature of the release means that anyone can modify DocVars. Based on the download count, it looks like several people have been using it, so there should be someone out there that has made some upgrades or changes.


Good luck.
JG

#96 wildthing

    Etomite Forum Newbie

  • Member
  • 11 posts

Posted 15 October 2005 - 11:22 AM

apodigm, on Sep 21 2004, 05:07 AM, said:

Here is something that you could do in the NewsListing snippet for example:

etomite->getDocVars($resource[$x]['id'],'extra_content');

This basically says to get the docvar called 'extra_content' related to the page numbered by $resource[$x]['id']
Good luck.

I'm trying to do this .... but when the snnipet is running Always showing word Array

Here i'm attach picture and modifed snippet code.... Can any one tell me what i'm doing wrong???? Thanks

Attached Files



#97 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 October 2005 - 08:23 PM

Is NewsListing calling DocVars? or vice versa.

Edited by apodigm, 15 October 2005 - 08:25 PM.


#98 apodigm

    Etomite Forum Newbie

  • Member
  • 41 posts

Posted 15 October 2005 - 08:35 PM

ok... try this in your Snippet code....

replace:
$price = $etomite->getDocVars($resource[$x]['id'],'price');


with this:
$tmp = $etomite->getDocVars($resource[$x]['id'],'price');
$price = $tmp['price'];

#99 wildthing

    Etomite Forum Newbie

  • Member
  • 11 posts

Posted 17 October 2005 - 10:27 AM

apodigm, on Oct 15 2005, 11:35 PM, said:

ok... try this in your Snippet code....

replace:
$price = $etomite->getDocVars($resource[$x]['id'],'price');
with this:
$tmp = $etomite->getDocVars($resource[$x]['id'],'price');
$price = $tmp['price'];

THANKS!!!! THAT IS GREAT!!! IT WAS SO SIPLE AT ALL!!!.... I WISH YOU LUCK!!!! :D

FOR OTHER... DOC VARS I'M NEED TO DO SAME?

#100 wildthing

    Etomite Forum Newbie

  • Member
  • 11 posts

Posted 20 October 2005 - 08:51 AM

Hi!!! Again)))))) My new question is.... HOW CAN I UPLOAD documents like Word or Exel files... or in some other types.... when i'm use the file form... this form upload only images... but not the document... Anyone can tell me what changes I need to do? :huh:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users