Is it possible to define different icons for placeholders, components and edit frames in the Sitecore page editor "component navigator"? - sitecore

When working in Sitecore page editor, our editors navigate through the tree of placeholders, components and edit frames using the blue arrow icon to open the component navigator.
The component navigator shows each ancestor in the tree (from the context of the area of the page where the editor clicked) with a title and a small blue square bullet icon:
/sitecore/shell/~/icon/ApplicationsV2/16x16/bullet_square_glass_blue.png.aspx
Unfortunately, all components, placeholders and edit frames are represented by the same icon, and it isn't always easy to tell the difference between a component and a placeholder by title alone (edit frame buttons have an editable title and tooltip, in the core database).
Ideally, we'd like to have colour coded bullet icons that would help our editors understand where they were and what they were clicking on.
These aren't icons as used in the content tree.
So is there anywhere that I can set a different icon for each of these? If not, is there a code fix for this?
Edit for clarification: The blue bullets in this image - Body is a placeholder, the first Image Banner is a component, the second an Edit Frame (will get a new title), Banner Overlay is another placeholder:

What you need to do is to edit javascript files for chosen ChromeTypes.
Go to sitecore\shell\Applications\Page Modes\ChromeTypes directory. What you see there is base ChromeType function and inheriting functions like PlaceholderChromeType, RenderingChromeType, etc.
Edit the type which you want to change icon for. Override icon function like this:
icon: function() {
return '/sitecore/shell/~/icon/ApplicationsV2/16x16/bullet_square_glass_green.png.aspx';
},
So if you edit PlaceholderChromeType.js file it should start like this:
Sitecore.PageModes.ChromeTypes.Placeholder = Sitecore.PageModes.ChromeTypes.ChromeType.extend( {
constructor: function() {
this.base();
},
icon: function() {
return '/sitecore/shell/~/icon/ApplicationsV2/16x16/bullet_square_glass_green.png.aspx';
},
controlId: function() {
var marker = this.chrome.openingMarker();
Clear your browser cache and refresh the page. Now all your placeholder icons will be green.

These are generally configured under WebEdit; as defined in the "core" database. As an example, take a look under "/sitecore/content/Applications/WebEdit/Edit Frame Buttons" after switching to "core".
You should be able to make most of the icon changes you require, from there.

Related

wxWidgets - Switch between different view on button click

I am making a music application, I have it show like a mini-view of the app as the default view, and I want it to switch to a big view on a button click. The default/mini view has a panel -> sizer -> sub-sizer -> widgets. And for the big view, I have a separate sizer and panel.
The default view looks like this
And when I press the L button on bottom right, I want it to switch to big view which is supposed to look like this
The top panel is empty here, I have not added widgets to it yet. I can provide additional information if required, like code snippets and all. But I want everything to be on the same wxFrame. I have defined all widgets in the constructor, but it overrides the previous panel and sizer. Also I want to be able to switch back and forth between the 2 layouts.
For completely replacing the frame contents like this you may find wxSimplebook useful as you can then just call its ChangeSelection() method to switch pages. You will need to adjust the frame size, e.g. by calling frame->SetClientSize(book->GetBestSize()), after switching pages manually however.

Draggable Regions in Oracle's APEX

Is it possible to move regions on the client side? I am not speaking in terms of the Page Designer/Grid Layout?
There doesn't seem to be any documentation on if it is possible.
This isn't supported "out of the box" in APEX, but since APEX uses jQuery it is easy to achieve using the jQuery draggable functionality. I have set up an example you can see here on apex.oracle.com. This is based on the Universal Theme.
Here are some screenshots showing the page as loaded and after I dragged the region down to the bottom right:
What I did was:
Create a "container" static content region with template "Blank with attributes" and static ID "container". This defines the area within which the main region can be dragged. I found that without this it could be dragged from side to side OK, but if dragged downwards it got clipped.
Create the draggable region as a "normal" APEX region with static ID "dept-report-rgn": I went for a classic report based on the DEPT table. I made it a sub-region of the container region, and assigned these CSS classes in the region "CSS Classes" property (under "Appearance"): ui-widget-content draggable-region. The class ui-widget-content is required by jQuery, and draggable-region is my own invention.
In page property "Javascript - Execute when page loads" I added the following code:
$( function() { $( ".draggable-region" ).draggable(); } );
This applies the jQuery draggable functionality to any element with the class "draggable-region". I could instead have targeted my specific region by selecting "#dept-report-rgn" instead of the class.
In page property "CSS - Inline" I added the following:
#container .container {height: 600px}
#dept-report-rgn { width: 300px; height: 300px; padding: 0.5em; }
The first line ensures that there is some vertical space within which the draggable region can move, the second specifies the size of the draggable region itself.
This may not quite what you need, but it hopefully shows you a way forward. You may also want to look at the jQuery droppable and sortable components (for example).

How to expose standard back button in view controller navigation?

I need users to be able to navigate a data hierarchy (master level, detail level) and to create new master and detail objects accordingly. Both master and detail use arrays for their model and TableViews for presentation
The navigation flow for this uses 2 navigation and table controllers like below. The + of the master and detail TableViews create new objects, the forstTableCell navigates to the second TableView using a segue:
While the screenshot shows "Done" right now even when removing that ButtonItem the slot remains empty.
I would like to show the standard back button instead: "< Middlewares" in this case. In the tests I've only been able to get the back button when navigating to a normal ViewController, but not to another NavigationController. Is it possible to have it between Navigation Controllers, too?
Simply remove the second navigation controller. If you use a push segue, your second view controller will still have the navigation bar. As long as you don't use a modal segue all view controllers that are pushed will have a navigation bar.
So your storyboard will look like this:
You will then automatically have a back button. If you want to change the text of it, go to your navigation item of your first view controller and change the back title accordingly as shown in this screenshot
You certainly want to have a title in your second view controller (something like "Add [whatever you want to add]". So simply drag & drop a UINavigationItem on your second view controller then you can also add UIBarButton items in your Interface builder
Controlling the look/feel of the Navigation Bar Buttons
You can achieve the behavior you want by opening the Document Outline and find the existing Done button. If you have a UIBarButtonItem type, you can simply change the type to Custom in the Inspector. Next add a regular button within the UIBarButtonItem (just bring the Navigation bar for the target controller into the zoomed in view of the storyboard/xib). This will allow you to drag a button onto the navigation bar.
Once you have a standard button you can add an image with the back arrow. Then add supporting code to use the pop behavior on the Navigation bar. Since you can have only one root navigation controller, you may want to remove the second UINavigationController and add a UINavigationItem from the objects library and then subsequently add the buttons, titles of your choice. This configuration will allow you to leverage all of the push and pop methods available, while retaining full control of the look/feel/behavior of the navigation stack.
More on customizing the look/feel/behavior of the UINavigation Stack can be found at: Navigation API Docs

How can I add a button in a footnote in Google Glass?

I'm trying to implement a footnote along with couple of buttons inside the footer.
Card card1.setFootnote("Footer");
Button btnSave = new Button(this)
Button btnClear = new Button(this)
card1.setButton(btnSave); //no option to put into card at footer
card1.setButton(btnClear); //no option to put into card at footer
How could I do this?
While you could modify the view hierarchy that gets returned by Card.toView() to insert whatever widgets you want, consider that this isn't the best approach for user interaction. Since Glass does not provide a touch screen, Button widgets make little sense on that form factor.
A better approach would be to add an options menu with your actions that would be presented when the user taps on the touchpad.
If you really want to do that Rakesk then i suggest you design your layout in landscape using xml. Size of that layout should be relative to 640 x 480 resolution. In this way you can add as many widgets in the UI as you want though it is not recommended.

How to show a ‘modal’ view (controller) *in* a tab bar interface without hiding the tab bar

I want to implement a ‘modal’ view like the ‘search’ view of the AppStore on the iPad.
When shown, it should:
Still show the tab bar. Selecting any of the items should take you to their view as normal.
No tab bar item is highlighted (because the search view is ‘modal’).
The closest I’ve come, with existing APIs, is:
On the ‘search’ view controller, set the UIModalPresentationCurrentContext modal presentation style.
Show ‘search’ view controller modal from the active view controller inside the tab bar controller (not from the tab bar controller itself).
However, this does not seem to be the right path:
View controller is shown underneath the status bar. I can work around that from -[UIViewController viewDidAppear:], but when changing the orientation of the device, this leads to all sorts of drawing issues and the controller, again, tucks itself underneath the status bar.
Tab bar item is still highlighted.
to keep showing the search bar just trim the modal view's hight so that it doesn't cover the tab bar.
For orientation changes, you just need to handle that by changing the view size and making sure the modal view is always brought to the front of all the views. You can modify that view's frame and contents programmatically or you can just create nibs for the orientations you want to support and load them up when it changes. Also note if you do change the view's frame programmatically you will probably need to resize/reposition fields as well.
For dealing with the tab bar, you should be able to turn off the highlighted item. So when you pop up the modal also make sure to turn off the highlighted item. If you want to interact with the toolbar from the modal view you can do that with delegates, passing an instance of the parent view (or just accessing parent view... I think you get that for free)