codeflood logo

Presentation How To

This page will show you how to perform some common tasks when dealing with presetnation in Sitecore using Revolver.

Copy Presentation between items and devices

There are 2 ways in which to copy presentation between items using Revolver. Firstly, we could just copy the presentation field (__renderings) data from the source item to the target. To achieve this in Revolver, navigate to the target item and execute the following.

sf __renderings < (gf -f __renderings /path/to/source/item)

We could also use the cpp command. As with most Revolver commands which accept a path, be careful about your source and target and which parameter is which. Revolver has tried to keep the convention that if a command accepts a path then it is the last parameter.

cpp /path/to/target
cpp /path/to/target /path/to/source

Both examples above copy presentation. The first example uses the current context item as the source.

We can also specify the source and target device for the copy. Using this command we can copy between devices of the same item, or between devices on different items. The first example below copies the presentation from the default device to the firefox device on the current context item. The second exmaple copies the presentation of the default device on the source item to the firefox device on the target item.

cpp -sd default -td firefox
cpp -sd default -td firefox /path/to/target /path/to/source