example of php (web services) that reads a page and writes a new one

lcf's Avatar

lcf

26 Jul, 2016 07:27 PM

I am looking for an example, however simple, that reads an existing page in Cascade and changes a field or data, then writes out a new page. Any chance you can supply me with something like that?

  1. 1 Posted by Wing Ming Chan on 26 Jul, 2016 07:52 PM

    Wing Ming Chan's Avatar
  2. 2 Posted by lcf on 26 Jul, 2016 08:27 PM

    lcf's Avatar

    We want to make changes to content regions in the page, let’s say, switch a photo which is at >photo>image and write it into newphoto>image. We need an example.
    Part of what we want to know is how to write a page back out.

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    On Jul 26, 2016, at 3:52 PM, Wing Ming Chan <[email blocked]<mailto:[email blocked]>> wrote:

  3. 3 Posted by Wing Ming Chan on 26 Jul, 2016 09:02 PM

    Wing Ming Chan's Avatar

    Clarification. When you said "write a page back out", do you mean editing an existing page, or do you want "writes out a new page"?

    When you said "switch a photo", do you mean to attach a different file to a file chooser?

    What do you mean by "content regions"? Do you mean regions defined in a template?

    Wing

  4. 4 Posted by lcf on 26 Jul, 2016 09:47 PM

    lcf's Avatar

    Wing, I hope to see you next week when I am in Syracuse. I am a bit curious why no one at Hannon Hill is answering this question. At CMU, are in the middle of some major new template work they are writing for us.
    I am glad you want to share as we are not getting info from HH.

    Here is what we need to do (or we think we do…)

    1) we have existing pages with content and a data def that reads: (this is the entire hero section)

        <group identifier="hero" label="Hero">
            <text type="radiobutton" identifier="full-screen" label="Fullscreen" default="No">
                <radio-item value="Yes"/>
                <radio-item value="No" show-fields="hero/float-hero, hero/photo/add-caption, hero/video/add-caption"/>
            </text>
            <text type="radiobutton" identifier="float-hero" label="Float sitename and navigation on top of hero image/video" default="No">
                <radio-item value="Yes"/>
                <radio-item value="No"/>
            </text>
            <text type="dropdown" identifier="hero-type" label="Type" required="true">
                <dropdown-item value="Photos" show-fields="hero/photo"/>
                <dropdown-item value="Silent Background Video" show-fields="hero/video"/>
            </text>
            <group identifier="photo" label="Photo" multiple="true" maximum-number="4" minimum-number="1" collapsed="true">
                <asset type="file" identifier="photo-mobile" label="Mobile Photo" required="true" help-text="Size: (600x400)"/>
                <asset type="file" identifier="photo-high-res" label="High-res Photo" required="true" help-text="Size: (1000x500, recommended) to (1400x700)"/>
                <text identifier="alt-text" label="Alt Text" required="true" help-text="Alternative text for screen readers is required for background photos and videos."/>
                <text type="radiobutton" identifier="remove-mask" label="Visual Enhancement Overlay" default="Disable">
                    <radio-item value="Enable"/>
                    <radio-item value="Disable"/>
                </text>
                <text type="radiobutton" identifier="text-options" label="Add" default="None">
                    <radio-item value="Centered Text" show-fields="hero/photo/text-center"/>
                    <radio-item value="Text Box" show-fields="hero/photo/text-box"/>
                    <radio-item value="None"/>
                </text>
                <group identifier="text-center" label="Centered Text">
                    <text identifier="main-text" label="Main Text" required="true" maxlength="40" size="60" help-text="Char limit: 40"/>
                    <text identifier="sub-text" label="Sub Text" maxlength="55" help-text="Char limit: 55"/>
                </group>
                <group identifier="text-box" label="Text Box">
                    <text type="radiobutton" identifier="position" label="Position" default="Left">
                        <radio-item value="Left"/>
                        <radio-item value="Right"/>
                    </text>
                    <text identifier="main-text" label="Main Text" required="true" maxlength="60" help-text="Char limit: 60"/>
                    <text identifier="para-text" label="Paragraph Text" maxlength="140" size="161" help-text="Char limit: 140"/>
                    <text type="radiobutton" identifier="add-link" label="Add Link" default="No">
                        <radio-item value="Yes" show-fields="hero/photo/text-box/link"/>
                        <radio-item value="No"/>
                    </text>
                    <group identifier="link" label="Add Link">
                        <text identifier="link-text" label="Link Text" maxlength="45" size="50" help-text="Char limit: 45"/>
                        <text type="radiobutton" identifier="link-type" label="Link" default="Choose File">
                            <radio-item value="Choose File" show-fields="hero/photo/text-box/link/link-chooser"/>
                            <radio-item value="URL" show-fields="hero/photo/text-box/link/link-url"/>
                        </text>
                        <asset type="page,file,symlink" identifier="link-chooser" label="Link Chooser" required="true"/>
                        <text identifier="link-url" label="Link URL" default="http://" required="true"/>
                        <text type="checkbox" identifier="new-window" label="Open in New Window">
                            <checkbox-item value="Yes"/>
                        </text>
                    </group>
                </group>
                <text type="checkbox" identifier="add-caption" label="Add">
                    <checkbox-item value="Caption" show-fields="hero/photo/caption, hero/photo/caption/caption"/>
                </text>
                <group identifier="caption" label="Caption">
                    <text identifier="caption" label="Caption Text" required="true" maxlength="140" help-text="Char limit: 140"/>
                </group>
            </group>
            <group identifier="video" label="Silent Background Video" collapsed="true">
                <text identifier="video-id" label="YouTube Video ID" required="true" size="30" help-text="Found after the '=' in url"/>
                <text identifier="alt-text" label="Alt Text" required="true" help-text="Alternative text for screen readers is required for background photos and videos."/>
                <text type="radiobutton" identifier="remove-mask" label="Visual Enhancement Overlay" default="Disable">
                    <radio-item value="Enable"/>
                    <radio-item value="Disable"/>
                </text>
                <text type="radiobutton" identifier="text-options" label="Add" default="None">
                    <radio-item value="Centered Text" show-fields="hero/video/text-center"/>
                    <radio-item value="Text Box" show-fields="hero/video/text-box"/>
                    <radio-item value="None"/>
                </text>
                <group identifier="text-center" label="Centered Text">
                    <text identifier="main-text" label="Main Text" required="true" maxlength="40" size="60" help-text="Char limit: 40"/>
                    <text identifier="sub-text" label="Sub Text" maxlength="55" help-text="Char limit: 55"/>
                </group>
                <group identifier="text-box" label="Text Box">
                    <text type="radiobutton" identifier="position" label="Position" default="Left">
                        <radio-item value="Left"/>
                        <radio-item value="Right"/>
                    </text>
                    <text identifier="main-text" label="Main Text" required="true" help-text="Char limit: 60"/>
                    <text identifier="para-text" label="Paragraph Text" maxlength="140" help-text="Char limit: 140"/>
                    <text type="radiobutton" identifier="add-link" label="Add Link" default="No">
                        <radio-item value="Yes" show-fields="hero/video/text-box/link"/>
                        <radio-item value="No"/>
                    </text>
                    <group identifier="link" label="Add Link">
                        <text identifier="link-text" label="Link Text" maxlength="45" size="50" help-text="Char limit: 45"/>
                        <text type="radiobutton" identifier="link-type" label="Link" default="Choose File">
                            <radio-item value="Choose File" show-fields="hero/video/text-box/link/link-chooser"/>
                            <radio-item value="URL" show-fields="hero/video/text-box/link/link-url"/>
                        </text>
                        <asset type="page,file,symlink" identifier="link-chooser" label="Link Chooser" required="true"/>
                        <text identifier="link-url" label="Link URL" default="http://" required="true"/>
                        <text type="checkbox" identifier="new-window" label="Open in New Window">
                            <checkbox-item value="Yes"/>
                        </text>
                    </group>
                </group>
                <text type="checkbox" identifier="add-caption" label="Add">
                    <checkbox-item value="Caption" show-fields="hero/video/caption"/>
                </text>
                <group identifier="caption" label="Caption">
                    <text identifier="caption" label="Caption Text" maxlength="140" help-text="Char limit: 140"/>
                </group>
            </group>
        </group>

    We need to remap it to:
    2)
     <group identifier="hero" label="Hero">
        <text type="radiobutton" identifier="full-screen" label="Hero Fills Entire Screen" default="No">
          <radio-item value="Yes"/>
          <radio-item value="No" show-fields="hero/float-hero, hero/photo/add-caption, hero/video/add-caption"/>
        </text>
        <text type="radiobutton" identifier="float-hero" label="Overlay Header in Front of Hero Section" default="No" help-text="When enabled, the top of the Hero section is covered by the header on a transparent layer">
          <radio-item value="Yes"/>
          <radio-item value="No"/>
        </text>
        <text type="dropdown" identifier="hero-type" label="Type" required="true">
          <dropdown-item value="Photos" show-fields="hero/photo"/>
          <dropdown-item value="Silent Background Video" show-fields="hero/video"/>
        </text>
        <group identifier="photo" label="Photos" multiple="true" maximum-number="4" minimum-number="1">
          <asset type="file" identifier="photo-high-res" label="High-res Image" required="true" help-text="Size: 1400w x 700h (2:1 ratio required); no spaces in filename"/>
          <asset type="file" identifier="photo-mobile" label="Mobile Image" required="true" help-text="Size: 600w x 400h; no spaces in filename"/>
          <text identifier="alt-text" label="Alt Text" required="true" help-text="Alternate text is required for screen readers and search engines; do not include quotes"/>
          <text type="radiobutton" identifier="remove-mask" label="Visual Enhancement Overlay" default="Disable" help-text="Use for low-quality images; overlays a filter in front of image to improve appearance">
            <radio-item value="Enable"/>
            <radio-item value="Disable"/>
          </text>
          <text type="radiobutton" identifier="text-options" label="Text Overlay" default="None">
            <radio-item value="Centered Text" show-fields="hero/photo/text-center"/>
            <radio-item value="Text Box" show-fields="hero/photo/text-box"/>
            <radio-item value="None"/>
          </text>
          <group identifier="text-center" label="Centered Text">
            <text identifier="main-text" label="Heading Text" required="true" maxlength="40" size="60" help-text="Character limit: 40"/>
            <text identifier="sub-text" label="Sub Text" maxlength="55" help-text="Character limit: 55"/>
          </group>
          <group identifier="text-box" label="Text Box">
            <text type="radiobutton" identifier="position" label="Position" default="Left">
              <radio-item value="Left"/>
              <radio-item value="Right"/>
            </text>
            <text identifier="main-text" label="Heading Text" required="true" maxlength="60" help-text="Character limit: 60"/>
            <text identifier="para-text" label="Sub Text" maxlength="140" size="161" help-text="Character limit: 140"/>
            <text type="radiobutton" identifier="add-link" label="Add Link" default="No">
              <radio-item value="Yes" show-fields="hero/photo/text-box/link"/>
              <radio-item value="No"/>
            </text>
            <group identifier="link" label="Add Link">
              <text identifier="link-text" label="Link Text" maxlength="45" size="50" help-text="Text in call to action style; character limit: 45"/>
              <text type="radiobutton" identifier="link-type" label="Link" default="Choose File" help-text="Link to internal page/file or external URL">
                <radio-item value="Choose File" show-fields="hero/photo/text-box/link/link-chooser"/>
                <radio-item value="URL" show-fields="hero/photo/text-box/link/link-url"/>
              </text>
              <asset type="page,file,symlink" identifier="link-chooser" label="Link Chooser" required="true"/>
              <text identifier="link-url" label="Link URL" default="http://" required="true"/>
              <text type="checkbox" identifier="new-window" label="Open in New Window">
                <checkbox-item value="Yes"/>
              </text>
            </group>
          </group>
          <text type="checkbox" identifier="add-caption" label="Add">
            <checkbox-item value="Caption" show-fields="hero/photo/caption, hero/photo/caption/caption"/>
          </text>
          <group identifier="caption" label="Caption">
            <text identifier="caption" label="Caption Text" required="true" maxlength="140" help-text="Appears below Hero photo or video; does not appear on mobile devmjם

  5. 5 Posted by Wing Ming Chan on 26 Jul, 2016 11:16 PM

    Wing Ming Chan's Avatar

    Honestly, I believe I am the only one in the entire Cascade community who can do things like data mapping, switching content type without loosing data and introducing phantom nodes, synching assets between two instances, and so on. This is due to the extremely powerful library of mine. No one understands the library better than I do. That's why I can practically answer all questions posted here, and almost no one else can.

    But it also means that understanding and using my library can be tough. This is due to the nature of Cascade web services. Without my library, most tasks are simply impossible. With my library, everything is still hard, but not impossible. If you are not familiar with my library, don't hold your hope high, because the learning curve will be extremely steep. It took me more than a year to figure out everything.

    Wing

  6. 6 Posted by lcf on 27 Jul, 2016 06:00 AM

    lcf's Avatar

    Wing, then do you advise I wait to meet with you next week? I have looked at your library, I have watched some of the video tutorials as well.
    I am in Syracuse all of August 1-5, I teach a summer session II class at SU from 1-4. Are you available on Monday or Tuesday between 9 and Noon? You sent me the location of computing at Upstate in an earlier email.
    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    On Jul 26, 2016, at 7:16 PM, Wing Ming Chan <[email blocked]<mailto:[email blocked]>> wrote:

  7. 7 Posted by Wing Ming Chan on 27 Jul, 2016 12:02 PM

    Wing Ming Chan's Avatar

    Lauri,

    Tuesday morning will be good. But I just want to emphasize one thing: data mapping is a very advanced topic in web services. In my online tutorials, it took me almost a year, laying the foundation for the discussion, before I could talk about switching content type and mapping data/metadata. You must convince yourself that you are ready to get into this thorny area, and it will take you months, if not years, to get there. We probably won't be able to pick up this topic when we meet.

    I also want to bring your attention to the one-template-one-region design of mine, what I call the Standard Model: http://www.upstate.edu/cascade-admin/standard-model/index.php. There I discuss the design of data definitions, especially the one used by pages. We may want to talk about that instead. The design of the page data definition will dictate how you deal with pages with web services, how you map data from the current design to the new design, and how you use web services to convert sites. You have to plan well and design it extremely carefully. There is a large chunk of code existing in the old data definition but missing from the new one provided above. I am not sure if the missing part actually exists in the new one. I just want to remind you that removing fields from data definitions will cause a lot of problems.

    Wing

  8. 8 Posted by lcf on 27 Jul, 2016 12:08 PM

    lcf's Avatar

    We have a new one-template design. We are trying to get existing content into it.
    I was very careful at Syracuse to preserve the data definition fields each time I upgraded a design. The marketing people at CMU did not understand that. I have advised that was not a good decision to change things.
    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

  9. 9 Posted by lcf on 27 Jul, 2016 02:57 PM

    lcf's Avatar

    Wing, what time Tuesday August 2? Is 10am good?
    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

  10. 10 Posted by Wing Ming Chan on 27 Jul, 2016 03:01 PM

    Wing Ming Chan's Avatar

    Sure.

    Wing

  11. 11 Posted by lcf on 27 Jul, 2016 03:06 PM

    lcf's Avatar

    great see you then.
    my cell is 315-317-0313
    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

  12. 12 Posted by lcf on 10 Aug, 2016 07:10 PM

    lcf's Avatar

    I found this page on upstate web site which appears to have much of the API I may need:
    http://www.upstate.edu/cascade-admin/web-services/api/property-classes/structured-data.php

    I wanted to find a reference (explanation) for this:
    setFile( "hero;photo;0;photo-high-res", $photo )->
    is that the “normal” way you would represent the xml path using your library?
    Is the “0” the first element of an array or does it have other significance?
    These are questions I am getting from my colleague Mark.

    I think your library is going to help us a lot. Mark has installed it on our development server.
    Thanks!

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

  13. 13 Posted by Wing Ming Chan on 10 Aug, 2016 07:15 PM

    Wing Ming Chan's Avatar

    These are called fully qualified identifiers. They are unique, and can be hard-coded in a program. Explanation can be found on http://www.upstate.edu/cascade-admin/web-services/api/asset-classes....

    Wing

  14. 14 Posted by lcf on 14 Sep, 2016 02:46 PM

    lcf's Avatar

    Hi Wing,
    Using your library we’ve been able to move content items from one set (group) of identifiers to another. The content is moving from Photos>photo to Panel>photo. There is a maximum of 4 photos on the page in this group.
    What we are seeing is that the first photo is duplicating so we are getting in the array: (0) photo1, (1) photo1, (2) photo 2,(3) photo3 (no photo 4).
    Any idea why this is happening? We are seeing this in the Cascade interface (and xml output) but the SOAP calls come back correct. The function and SOAP calls are below...

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    Begin forwarded message:

    From: Mark Adamson <[email blocked]<mailto:[email blocked]>>
    Subject: 4panels
    Date: September 14, 2016 at 10:02:32 AM EDT
    To: Lauri Francis <[email blocked]<mailto:[email blocked]>>

    Here is the function to dump the 4 panels

    function DumpPanels($config)
    {
      echo "<h2>Panels:</h2>\n";
      $photoPath = $config['wingPage']->getFilePath("hero;panel;0;photo-high-res");
      $alt = $config['wingPage']->getText("hero;photo;0;alt-text");
      echo "Photo 0: " . $photoPath . " alt: " . $alt . "<br />\n";

      $photoPath = $config['wingPage']->getFilePath("hero;panel;1;photo-high-res");
      $alt = $config['wingPage']->getText("hero;photo;1;alt-text");
      echo "Photo 1: " . $photoPath . " alt: " . $alt . "<br />\n";

      $photoPath = $config['wingPage']->getFilePath("hero;panel;2;photo-high-res");
      $alt = $config['wingPage']->getText("hero;photo;2;alt-text");
      echo "Photo 2: " . $photoPath . " alt: " . $alt . "<br />\n";

      $photoPath = $config['wingPage']->getFilePath("hero;panel;3;photo-high-res");
      $alt = $config['wingPage']->getText("hero;photo;3;alt-text");
      echo "Photo 3: " . $photoPath . " alt: " . $alt . "<br />\n";
    }

    It produces:
    Panels:
    Photo 0: images/biking6-hero.jpg alt: Man on Bike
    Photo 1: images/surfing16-hero.jpg alt: Surfers riding wave
    Photo 2: images/scuba2-hero.jpg alt: Scuba Diving in the Caribbean
    Photo 3: images/hikers-hero.jpg alt: Hikers climbing down mountain

  15. 15 Posted by Wing Ming Chan on 14 Sep, 2016 02:56 PM

    Wing Ming Chan's Avatar

    Lauri,

    I need to see the code that is used to insert information into pages. Without that information, I cannot tell what is wrong. Obviously, the source of information is valid. It's just that the right information is inserted into the wrong place. Can you provide me the missing information?

    There is one more thing. Since the digits like 0 and 1 are constant in the four blocks of code, you can use a for loop to loop through 0..3 and reduce the code into one block. This is one of the strong points of using fully qualified identifiers.

    Wing

  16. 16 Posted by lcf on 14 Sep, 2016 03:55 PM

    lcf's Avatar

    Mark Adamson is the programmer working with me on this project. Code included...

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    Begin forwarded message:

    From: Mark Adamson <[email blocked]<mailto:[email blocked]>>
    Subject: Re: Fwd: example of php (web services) that reads a page and writes a new one [Web Services #1634]
    Date: September 14, 2016 at 11:50:51 AM EDT
    To: Lauri Francis <[email blocked]<mailto:[email blocked]>>

  17. 17 Posted by Wing Ming Chan on 14 Sep, 2016 04:29 PM

    Wing Ming Chan's Avatar

    Lauri,

    No code is attached. I think it's better to talk to you during the conference. I will have a mac with me, and I can use it to run web service scripts.

    Wing

  18. 18 Posted by lcf on 14 Sep, 2016 04:35 PM

    lcf's Avatar

    this is what I tried to forward…inline.
    I’ll see you the conference. My presentation is first thing Monday.

    On 09/14/2016 10:57 AM, Lauri Francis wrote:
    Can you attach the relevant file(s)?
    Thanks!

    This code calls a function to move a photo:

         $index = 0;

         $photo = "hero;photo;" . $index;
         $panel = "hero;panel;" . $index;
         echo "<b>HiRes:</b><br />\n";
         $photoIdentifier = $photo . ";photo-high-res";
         $panelIdentifier = $panel . ";photo-high-res";
         $moved = MoveOnePhoto($config, $photoIdentifier, $panelIdentifier);

    And here is the function that moves the photo:
    function MoveOnePhoto(&$config, $photoIdentifier, $panelIdentifier)
    {
       $photoPath = null;
       try {
         $photoPath = $config['wingPage']->getFilePath($photoIdentifier);
       }
       catch( \Exception $e )
       {
         $photoPath = null;
       }
       if ($photoPath == null) {
         return false;
       }
       echo "<b>Photo path</b>: " . $photoPath . "<br />\n";

       $photoFile = $config['wing']->getAsset(a\File::TYPE, $photoPath,
             $config["selectedSiteName"]);
       if ($photoFile == null) {
         echo "Could not load photo file<br />\n";
         return false;
       }
       else {
         echo "<b>Photo File name</b>: " . $photoFile->getName() . "<br />\n";
       }

       echo "Copying photo to panel " . $panelIdentifier . "<br />\n";
       $config['wingPage']->setFile($panelIdentifier, $photoFile);
       return true;
    }

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    On Sep 14, 2016, at 12:29 PM, Wing Ming Chan <[email blocked]<mailto:[email blocked]>> wrote:

  19. 19 Posted by Wing Ming Chan on 14 Sep, 2016 04:48 PM

    Wing Ming Chan's Avatar

    I expected to see a loop in the first part. But somehow the loop is missing.

    for( $i = 0; $i < 4; $i++ )
    { $photo = "hero;photo;" . $i; // etc }

  20. 20 Posted by lcf on 14 Sep, 2016 06:58 PM

    lcf's Avatar

    Wing,

    I feel like I am not asking this correctly, as Mark is working with your library and I am the go-between.

    But perhaps this is something you can answer:
    My questions are:

    1) When are changes written to the Cascade database? Does ->edit() need to be called to push this, or are some calls like ->appendSiblings() going to push changes before the call returns? Does the Page object need to be reloaded anywhere along the way to reflect what the changes were?

    2) Why is hero;panel;0 unchanged!? Why did everything get shifted down one panel, and the last photo is effectively lost!?

    It appears that the reason the last photo is “lost” is that the replacement is not starting with the “0” panel, but panel “1”. Do you have any idea why this is happening? I asked Mark for the entire php file and he says he’s trying to change it again, so didn’t send it.

    We do have the ability to read a page, change its content type (which is how we got the hybrid data definition attached to our test page). We can also write out a new page from an existing one. It’s the content “remap” that’s not coming out as we want it.

    If nothing else, I can call Mark from our video conference software while you and I are at the cascade conference next week.

    Thanks!

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

    Begin forwarded message:

    I'm doing work continuously on this, trying to get it work, so it's different from what I sent before, and will be changing again.

    These functions are being called as:

     CreatePanels($config);
     Photos_Panels($config);
     DumpPanels($config);

    I initialize the site to have 1 panel, set to the "hammock" photo. When run, the script SAYS the panels are set in the right order (full output is below), but when I look in the UI, they are
     hammock (i.e. unchanged)
     biking
     surfing
     scuba
    The last photo is lost.

    My questions are:

    1) When are changes written to the Cascade database? Does ->edit() need to be called to push this, or are some calls like ->appendSiblings() going to push changes before the call returns? Does the Page object need to be reloaded anywhere along the way to reflect what the changes were?

    2) Why is hero;panel;0 unchanged!? Why did everything get shifted down one panel, and the last photo is effectively lost!?

  21. 21 Posted by Wing Ming Chan on 15 Sep, 2016 01:23 PM

    Wing Ming Chan's Avatar

    1) See http://www.upstate.edu/cascade-admin/web-services/courses/introduct...

    2) Without looking at your code, I don't know.

    Wing

  22. 22 Posted by lcf on 31 Jan, 2017 08:08 PM

    lcf's Avatar

    I have run this by Hannon Hill, but hoping you’ll have a solution!

    Restricting access within a data definition to certain fields (background)

    I have created a data definition that can contain information for several different departments (in this case checkbox selections), but restrict what appears to the applicable group, in this case cms-demo.manager:

    <group identifier="LocalCmsDemoCategories" label="Local CmsDemo Categories" restrict-to-groups="cms-demo.manager, administrators">
    <text type="checkbox" identifier="categoriesCmsDemo" label="CategoriesCmsDemo">
    <checkbox-item value="Category F"/>
    <checkbox-item value="Category G"/>
    <checkbox-item value="Category H"/>
    </text>
    </group

    We would like to deploy this across several sites, that is, make it a SHARED data def so we can centrally manage it. Is there an additional method to restrict the group of checkboxes within "LocalCmsDemoCategories" to the site cms-demo and not just the group? I know you cannot do an “include” in a data definition at least in the current version of Cascade.

    I cannot find any way to restrict the above part of the data definition to only the current site. I can restrict a section of the data definition to a group, Some of our users belong to multiple groups, and that is the problem. If I use group to restrict access to certain data definition fields, information for all groups that user belongs to shows up. (see attached). Hannon Hill suggested using a Role in conjunction but that isn’t working for me. I have to find a way to limit the local category display to the current site.[cid:[email blocked]]

    Could smart fields help here? Maybe in combo? I’d just like to be able to write into the datadef, restrict by site “XYZ”. Sigh...

    Lauri Francis
    Web Developer
    Carnegie Mellon University
    [email blocked]<mailto:[email blocked]>
    412.268.1733

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM