Is there any way to force "View as Visitor Group" to show in edit mode? - episerver

The "View as Visitor Group" option only shows in the EPiServer editor when there is content for visitor groups added to the rich text areas. If you have code based customisations then this makes it hard to preview your changes.
Is it possible to trigger this to show all the time or based on some decision in code?
Currently the workaround is to temporarily add some visitor group content to a text area, save & view, then "View as Visitor Group", then delete the temporary content in the text area before saving which isn't ideal.
This is EPiServer 6R2 (aka 6.1)
Original question: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=74864 (lifeless forum, ugh). Posted here as I also want to know the answer as I'm working on similar functionality to the original author.

There is an interface IPersonalizedRoles that makes the View as visitor group menu appear if it is implemented on a property. However I think you have to create a custom property to use the interface yourself.
The SDK for the interface: http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/68f4d6ca-e9a5-884d-4ca8-e5431a345112
You implement GetRoles() and return an IEnumerable with the visitor group GUID ID:s that you want to show up in the list.
Maybe you can create a custom dummy property and return your groups there?

Related

How to show more fields on custom object tabs in Salesforce?

Ok so this problem is probably easily solvable, but since I am a beginner in Salesforce and I didn't find anything useful on Google, I am asking if someone can please help me.
So, as you can see, I have created a custom object called Students, and added some fields to it.
Next, I have created a custom object tab, called Student, as you can see on the following image and added some records.
On the custom object tab, only field 'Student Name' is shown. Does anybody know how to display all (or some) of the fields that were added to the object Student?
Thank you so much for your answers and have a great day :)
On the far right of the 2nd screenshot there's a gear/cog icon. Use it for o create new "list view". Or click that "recently viewed", change it to "all" (there should be an auto-generated one for you) and use that gear icon to select which fields to display.
You can even pin the list view to be your default if you don't want "recently viewed".
As for recently viewed itself - it's special, the gear icon won't work. Follow this article: https://help.salesforce.com/s/articleView?id=sf.customize_recent_records_list_lex.htm&type=5

2sxc Dnn.. Add existing content items to module

I have a view of entities which are being displayed based on an entity type filter. I now need to reorder these and would like to use the built in 2sxc functionality to do this, so I have a created a new view of the data using the "module data source" so that the ordering will work.
But how do I now make all of the existing entities of the same type (definition) appear in this new view? The view now displays one item by default and I can replace that one item. But how do I add multiple existing items? I need the Entity ID's to remain the same for Query String usage and SEO.
Thanks, hope the question makes sense.
Cheers
I believe that you are asking "how can I add many items to an instance (module) manually, so that I can also sort them manually" - is this correct?
If yes, then you must make sure your template supports lists (checkbox in the template settings). This then gives you a [+] button; but you don't want to use that, as it would be for typing in new data. There's another button called "add an empty demo entry" which you'll see as a round (+) after pressing the more ... button once. Pressing this will give you empty entries, into which you can then replace existing items.

Panel Pane visibility rule based on users in entity reference field

I have a content type called 'company' with an entity reference field called 'company_managers' referencing users who will be allowed to add and edit other content types relating to this company.
The company node is displayed using panels. What I am struggling with is to create a visibility rule which will only show a panel-pane if the logged in user is referenced in the entity field 'company_managers' this will allow me to show panel panes specific to users in the 'company_managers' field.
So the psudo logic for the visibility rule would be:
Check if logged in user is contained in 'company_managers'
If yes show panel-pane
if no
dont show pane.
This seems such a simple use case that i dont want to create custom code it must be achievable 'out the box' I just cant seem to get to the answer. So after two days of researching am asking for help.
NOTE: have spoofed this behavior using the visibility rule content manager and manually selecting a user on this site. All I would need is to put in the logged in user but I dont think you can put in dynamic variables or tokens.
Help much appreciated.

Visualforce Custom lookup visualforce page

I was wondering if there is a way to override the native functionality of the lookup field in Salesforce and replace it with a visualforce page. The reason I'm trying to override this button is because when the user does a look up, the look up returns everybody with that name. What we want to return is a list of all the contacts by account for the contact being searched.
Here's what I'm trying to achieve:
When the user clicks the lookup button my visualforce page will launch and allow the user to see the account and all the contacts of that account.
Is this even possible? What other ways would you suggest going about this?
Here's a screen shot of what I'm trying to change:
Thanks for all your help!
It sounds really like you just need to customise the columns on the lookup to make it better suited to your needs. If you go to Setup -> Customize -> Contacts -> Search Layouts, you'll see entries for Lookup Dialogs and Lookup Phone Dialogs, there you can edit the columns displayed in the lookup windows.
If you really need a custom solution:
You can't override the lookup page itself, but you could create a new visualforce page for your account, using <apex:detail> and other similar tags to make your life simpler. Then you could include a search section underneath, where a user can enter various search terms which you put into a dynamic SOQL query and then render the results for them to choose from.
yeah its possible by javascript as i did by visual force page that will show the records of related lists and upon selection id of that record passed to parent window by jscipt. and performed same functionality ..
As far as I know - NO.
As a workaround you can use JavaScript.
What we did in our situation? We implement everything in JavaScript. We created an inputText and right on the right of this inputText we placed image with this lookup icon. On image click we create ExtJS popup window (I think you can simply create VF page and show this page in popup window). After window was closed you fill in the inputText field.
There's no out-of-the-box override for this button, last I checked, so something custom would be required. If you're set on having a popup and do not want an inline solution, I'd recommend reviewing this tutorial to get familiar with some of the issues with popups in Visualforce.
But considering what you are looking to accomplish, you could also have your account and filtered list of all contacts associated with that account appear inline on your page when the user clicks a new, custom search button. Of course that page would itself be in Visualforce (or inline Visualforce in a standard page layout) - which you may or may not want to have to code and maintain.
The AJAX Toolkit might also be a good place to start if you want to go with a custom JavaScript button placed on a standard page layout.

Salesforce Custom Objects

Hi I am trying to create a Custom Object in Salesforce.com Developer Edition, because I would then like to use this Custom Object in a New Custom Tab say "Properties". Properties tab will contain information about Realestate Properties, like # of rooms, bath rooms etc.
The problem I cannot seem to get around is how do I create a Custom Object that has many attributes. When I go to Setup->Create->Objects it only has one Label in the Custom Object definition page. I am expecting many attributes/labels I can add so I can then put this into the new Tab.
I've been looking at this for a while and I do not see a solution, so I am assuming I am looking at this wrong. Could someone recommend a solution or a book, article that would show me what I am missing.
Thanks
The custom objects page shows a list of all the custom objects you have created. If you click on the label, it takes you to the object definition. To add more attributes (called "fields" in Salesforce), go to the "Custom Fields & Relationships" section on the object detail page. Click to "New" button to add new fields from there.
Salesforce has a huge amount of publicly available training material available online.
The fundamentals doc should provide you with what you need immediately (http://www.salesforce.com/us/developer/docs/fundamentals/index.htm).
I also recommend looking at the training courses available on iTunes (search for Salesforce).

Resources