Important announcements from CouchCMS team
51 posts Page 5 of 6
Previous 1, 2, 3, 4, 5, 6 Next
@KK Sir.
Thanks for the response sir. I have tried the dropdown approach just today, and it seems to be fit as of where my current development is.
The cms:alt_js I happened to skip. So I will also give it a try.

Is there a better way to implement a user role based access?

Sir you had once mentioned (sorry I could not locate that PM/post), that some changes are on card for role based user access like in SugarCRM (screenshot). I feel such a module/add-on would be even more useful since it will give the customers a great control over there applications developed in CouchCMS. Any thoughts on this sir?

Regards,
GenXCoders (Aashish)
Image
where innovation meets technology
@KK, can conditional fields be used in the following scenario?

I would like to get multiple dropdowns with folders set to a depth of 1 that are conditioned by the previous selection.

The first dropdown would show the main folders
Second one would show the children of previous selection but also with a depth of 1
And so on so forth.
@aleksandru, what you are actually looking for is something like the 'Hierarchical Select' mentioned by @trendoman here -
viewtopic.php?f=2&t=12504#p35036

Unfortunately though, we don't yet have a feature like that I am sorry.
KK wrote: @aleksandru, what you are actually looking for is something like the 'Hierarchical Select' mentioned by @trendoman here -
viewtopic.php?f=2&t=12504#p35036

Unfortunately though, we don't yet have a feature like that I am sorry.


Got it, thank you.
I used a work-around with Javascript after dumping all the hierarchy of the folders and asigning levels to them :)
@aleksandru
Great :)
Wonder if you'd be willing to share your code with us here on the forum?
I am sure it'd be useful for many.

Thanks.
KK wrote: @aleksandru
Great :)
Wonder if you'd be willing to share your code with us here on the forum?
I am sure it'd be useful for many.

Thanks.


@KK,
What I actually ended up doing is using QueryStrings and conditional statements while limiting the folders to a depth of 1 and making use of childof to take the parent from the query string if it is available.

As it is right now I am actually updating one single dropdown but it can easily be changed to show/hide multiple dropdowns.

I found this setup quite easy and useful in my case since I am using it on the front-end and not on the admin panel.


Code: Select all
<cms:set q_client = "<cms:gpc 'q_client' />" />
<cms:set q_project = "<cms:gpc 'q_project' />" />
<cms:set q_phase = "<cms:gpc 'q_phase' />" />
<cms:set q_start_link = "<cms:link masterpage='used_here.php' />" />

    <cms:if q_project>
      <label>Select a phase</label>
      <select name="clients" class="dropdown">
           <cms:folders masterpage="projects.php" hierarchical="1" order="desc" childof=q_project depth='1'>
            <option value="<cms:add_querystring q_start_link "q_client=<cms:show q_client />&q_project=<cms:show q_project />&q_phase=<cms:show k_folder_name />" />"><cms:show k_folder_title /></option>
            </cms:folders>
      </select>
    <cms:else />
        <cms:if q_client >
            <label>Select a project</label>
            <select name="clients" class="dropdown">
                <cms:folders masterpage="projects.php" hierarchical="1" order="desc" childof=q_client depth='1'>
                    <option value="<cms:add_querystring k_page_link "q_client=<cms:show q_client />&q_project=<cms:show k_folder_name />" />"><cms:show k_folder_title /></option>
                </cms:folders>
            </select>
        <cms:else />
            <label>Select a client</label>
            <select name="clients" class="dropdown">
                <cms:folders masterpage="projects.php" hierarchical="1" order="desc" depth="1">
                    <option value="<cms:add_querystring k_page_link "q_client=<cms:show k_folder_name />" />"><cms:show k_folder_title /></option>
                </cms:folders>
            </select>
        </cms:if>
    </cms:if>
Thank you, @aleksandru :)
KK wrote: Thank you, @aleksandru :)


@KK,

Let me ask you just as a curiosity, could this be also implemented in the admin panel ?
Maybe with the use of snippets ? I am not sure at this point if querystrings work with the admin panel :-?
aleksandru wrote: @KK,

Let me ask you just as a curiosity, could this be also implemented in the admin panel ?
Maybe with the use of snippets ? I am not sure at this point if querystrings work with the admin panel :-?


Query strings work with admin panel. Also dropdown field's opt_values can be fully dynamic and depend on query string parameter. Instead of k_page_link, admin-panel's base link (to which we add qs) would be k_route_link and actual link with entire qs would be k_qs_link.

I suggest to not reply or comment here, but open a new topic for any further discussion. ☺
@KK, why wouldn't a second conditional form work in AdminPanel? I am seeing both CSS, JS parts generated fine, but the second form's controlling element is unresponsive. :) I added a second form via config_form_view's dummy <cms:field>. :) It's a somewhat uncommon way of adding another form and I did not have expectations, but perhaps this little puzzle may be interesting.

Attachments

Previous 1, 2, 3, 4, 5, 6 Next
51 posts Page 5 of 6