Using custom pushpins in my Windows 8.1 XAML app using Bing Maps SDK - c++

In my C++/XAML Windows 8.1 app, I want to use a pushpin to denote a location that the user has selected. The default pushpin is very limited and it doesn't even show all the text I add to the "Text" field of the pushpin.
I really want to show something similar to the default pushpin and under that a textblock with some text.
So I think I have to create a user control and use it as a custom pushpin. However, when I do this the "custom pushpin" doesn't appear on the map at the same location that the user selected. It feels like in order to get it at the same location, I need to get the margins of the user control right through hit and trial. What is the correct way to achieve what I am trying to do?

After playing around a little more, I was able to specify the correct position of the custom pushpin using the following API:
Bing::Maps::MapLayer::SetPositionAnchor(Windows::UI::Xaml::DependencyObject^, Windows::Foundation::Point)
See the API reference here.

Related

Joomla 3.8 switching templates/styles?

Okay, so I understand that you can set a template/style in a menu item which I understand. However.. What would you do in this situation..
The website uses two different templates/styles depending on what section of the website they are in.
What if you are in section 1 of the website and need to go to section 2 that uses a different style? And this action is controlled by a controller on if a condition is met.
I've managed to do this so far using $app->redirect and including the Menu Id so that joomla picks up the correct template/style to use. However this just seems wrong, as I can't determine the Menu Id once the component is installed elsewhere...
Doing the getView() approach to show a certain view seems like the correct procedure, however it doesn't allow me to change the template/style and will use the template/style from the original menu item.
Is there another method I don't know about? Does Joomla simply not have something in place for this? It's almost as if I need to change getView to accept a template/style parameter
They changed the name Template/Style to theme.
JFactory::getApplication()->set('theme', 'my_system');

Sitecore Glass Mapper - Using Item Renderings

I'm setting up a carousel in Sitecore using Glass Mapper. In the foreach loop to generate each carousel item, I can get the items out easily enough and make them editable with the #Editable command. What this doesn't give, however, is finer control over the edit process. For example, I want to edit the background image using a custom button in the Experience Editor, but I need to set that up in a rendering.
If I was using straight Sitecore, it looks like I'd use Html.Sitecore().ItemRendering and pass in the carousel item as a regular Sitecore item. In this case, I have my strongly-type class from Glass Mapper, which can't be passed in that way.
Is there a comparable method in Glass Mapper for setting up an item rendering? Or is there another way to affect the Experience Editor buttons for the carousel items? I've also experimented with setting up a separate edit mode, which would work fine, but I wanted to put together a cleaner editing experience with a more WYSIWYG approach to the item.
You'll have to use Custom User Experience Buttons which will allow you to edit in Page Editor Mode.
I just googled and found couple of good article which might help you.
http://www.nishtechinc.com/Blog/2015/March/A%20Better%20Approach%20at%20Carousel%20Management
http://www.awareweb.com/awareblog/11-25-14-custombuttonspageeditor
Try Html.Glass().BeginEditFrame() functionality built into Glass Mapper, wrapped in a #using block.
It allows you to specify the fields you wish to edit directly as params. Or if you're feeling adventurous, it can point to a full edit frame configuration in the core DB.

How to better manage versions in Sitecore Page Editor

The way that Page Editor handles versions has been causing issues for in one of our Sitecore solutions for a client. I've posted about them here:
Sitecore instance showing incorrect workflow state in Page Editor
Expected usage of Page Editor's Experience date
I didn't get much response on those and so far I've surmised that this is just how Sitecore works. This is less than ideal for our instance, as when publishing restrictions are set, authors don't know which version they're editing which is causing various issues for them.
I'd like to implement a solution(s) to improve the experience provide the following functionality:
Something in the Experience tab that shows the number of the version being viewed.
A button on the Experience tab that resets the Date to the default (this is not simply setting the date to the current date/time, but resetting it to act as it did before a date was manually set).
A custom button in Content Editor which allows an author to open a specific version in Page Editor...set the date automatically when it opens, I guess.
An any one give me some clues on how much of this is possible and where to start?
Thanks.
For the first bullet "Something in the Experience tab that shows the number of the version being viewed", you can add version item in Core database.
Move to "Core" DB in Desktop Mode
Navigate to "/sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Experience/"
Create "Versions" item like this, http://imgur.com/bPEDm7R
Create "Compare" item under "Versions" like this, http://imgur.com/dG8dz2M
The result like this, http://imgur.com/HPu3XAL
The content author can see which version they are using and they can also compare with previous versions.

How to change a control's Placeholder by device?

Using Sitecore 7 - Is there a way I can specify what the placeholder of a template's control will be based on device?
Example : Placeholder A if the device is Mobile else Placeholder B
This is more to do with positioning the content differently in Mobile than desktop site.
UPDATE
Trayek's answer is great and would sure work. Although, I ended up using a different approach.
In the layout details of my template, I added a control C; set its placeholder as A and added HideBydevice Desktop in the additional Parameters section. Then, I again added control C; set its placeholder as B and added HideBydevice Mobile in the additional Parameters section.
Then in my code, I check HideBydevice parameter's value and hide the sublayout/control, if the parameter's value is the same as Sitecore.Context.Device.Name
This worked for me.
What you can probably do is use Sitecore's Rules Engine, where you can create (or use a pre-existing) Condition to find out whether you are on a mobile device (to do this, you could use the Mobile Device Detector for instance - although I don't know if that module is supported on Sitecore 7).
Then, you can also use the Action Set placeholder to value.
You could also create your own Action instead, of course. All you'd have to do is get the RenderingReference and simply change the placeholder like so:
var reference = new RenderingReference(this.RenderingID);
reference.Placeholder = "A";
More on this in the Rules Engine Cookbook
Update
I've written a blog post about how to get this done: Read it here.

Sitecore Page Editor issue

I was trying to move components in Page Editor mode , and below are the things I have done to achieve this :
Set Compatible rendering selected for the Sublayouts
Added placeholder settings and allowed controls for placeholders
But , when I was trying to move components, the DataSourceItems for the sublayouts are not changing , hence the content is not changing.
And , also sometime I am getting Field related errors if the fields are different in the DataSources.
Can someone please help me in this .
From your question, it sounds like you are trying to move a component from one placeholder to another in Page Editor. That does not affect the data source.
If instead you mean you are trying to personalize the experience by using rules to switch the data source within a sublayout, the steps you've taken won't allow for that. You need to add conditions to the sublayout in Page Editor to choose which data source you want to display.
If you are trying to have compatible renderings (different sublayouts) show for the same placeholder, that is something that is done by your step 1. This is only to help authors know what other sublayouts would be a good idea to put in that placeholder. It does not affect the data source.
When you add components, the datasource for them is not set automatically. You need to check if it's set and use Sitecore.Context.Item if it's not.
Not sure if that's what you mean..
As for field related errors, please post more details.