Export list of Related lists by object and layout - salesforce

I am trying to export a list of related lists per record type and layout, for the Contact object.
Do you know any way to do that?
maybe with Data Inspector
thank you for help

Related

Redux Structure Advice

I've built a few React Native apps with Redux and I've traditionally modeled my state after the views/ui. I've come to realize that this isn't the best way to organize Redux state.
Through some recent research, I know now that it's best practice to not store duplicate data in different reducers, as updating them can become tedious. It's better to store data in objects with the keys being the id and the value being the data object itself.
This makes sense for data that will be the same on every screen/page, but what if your app uses the data differently on different screens?
For example:
I have a list of products on a home screen and a list of products on a category screen. Both have pagination and are looking at different subsets of the product data. I could use a selector method here and only select products belonging to the specific category on the category screen, but how would that work with keeping track of pagination data for each one?
If I scroll down on the home screen and load a bunch of product data, then switch to the category screen, I'll have more data already loaded.
Any advice is appreciated, thanks!
You should normalize your data (https://github.com/paularmstrong/normalizr) so you can have your redux state like:
{
home: [...list_of_id_products],
category: [...list_of_id_products],
data: [actual_array_of_objects]
}
then you can have separated lists, all linked to the same set of data

Parse Class Relations query

I am using Parse.com Tool.
I have a Post class where it contains list of posts.
Users can like the post which happens by storing the action in a Like class with pointer to the post id in the Post class and pointer to the user id in the User class.
The problem I am trying to solve is the following:
When I get the list of posts, I want to know which of them the user liked and which he didn't.
What's the best solution knowing that this list can be long list.
I would do two queries.
Get the Posts you want.
Get the ids of the Posts from the Likes table, where the User pointer is pointing to your current user.
Then compare the lists against each other.
If you only want Posts that the user has liked and not others you could do one query to the Likes table and get the Post object from that.
Provide a few more details if you want some code. Like what you are developing for (ios, android, web).

Create new field type for custom content

I want to create a new content type called "Message". It will have a couple of fields, "message-body" which will be plain text and "addressees". The addressees field should reflect a list of the registered users of the site.
The idea is to create a field type that will be a checklist where all users of the site can be selected, and those that are will receive the message in "message-body" via drupal_set_message($msg).
I am not suceeding so far in creating a custom field type. The Field API documentation is not very clear.
Thanks.
You maybe already found the solutions for you problem.
I think in your case you can use Entity Reference. In your custom content type you can create a new field with the Entity Reference type. Then on the configuration page you can choose which entity to reference, like node, taxonomy or users, with different types of widget.
Here's a link of the Entity Reference module.
Why not make a content type via the menu interface www.yoursite.com/admin/structure/types/add.
Or you need it as a module that you can re-distribute?
An easier way then is to make use of features. It allows you to 'export' a built content type into a module. Enabling the module (on another site), then creates all the fields that where in the export.

Nested Content Type in Drupal 7

as everybody can see i am new in drupal. So... i have a new site that has so much pages, and i had identified some blocks of information that are repeated in some of these pages . So... i had created my own content types trying to make them reutilizables. But my question is... Is any way to make a content type B that contents one ore more content types B? or i must create a content type for every page i have.
Other question i have is, a content type defines the structure(what fields are in) of an information part of a page, but how i then order and define where they must apear and how the must apear.
Thank you in advance.
You might try the Entity Reference module: http://drupal.org/project/entityreference

Render a page differently based on which list that opened it

I have two lists of different PageTypes - NewsItems and PressReleases. They are displayed in one list each, with links to the individual items.
Now I want to include the press release items into the news list and use the style of the news items to display them as news items. They share properties like "Heading" and "BodyText", which are used in the News Template.
I imagine that it won't be that difficult to feed the NewsItems' ListPage with both sets of pages, but I don't understand how I can control the rendering of the item page.
I would like to take the PageData object from a NewsItem OR a PressReleaseItem and display it using the News-Item.aspx template, if it is selected in a NewsList. But EPiServer will always render the PressReleaseItem with the PR-Item.aspx since it's coupled in the PageType settings.
Anyone know how to accomplish this?
EDIT: An effort to clarify:
The important issue is how to know the "list parent" and choose the right template from that. In the ListPage I can apply different looks on the PR and News items respectively using tompipes answer, but when selecting to see an individual item EPi will render the PR-Item-1 the same way regardless of their "list parent". That's the problem.
I'm not following exactly what you are attempting here. But I think I get the gist of it.
Why not use one aspx template for both page types, but in the code behind switch off sections using the visible attribute.
If you are using PageTypeBuilder you could use the "is" keyword:
somePlaceHolder.Visible = CurrentPage is NewsItemList;
If you're not using PTB, you could use something like:
somePlaceholder.Visble = CurrentPage.PageTypeID == 10;
or
somePlaceholder.Visble = CurrentPage.PageTypeName == "NewsItemList";
I'll point out now I'm not a fan of hardcoding anything, so I would place the template name, or ID into a config file, or a property on the start/root page to avoid hardcoding them.
Let me know if this will help, or if I have misunderstood please try elaborate on your issue.
Depending on how much the templates share you could go with user controls, placeholders or even different masterpages to switch view in a suitable way.
To know when to switch you could use a querystring parameter, session variable or the nicest looking way would probably be to lookup and get the list's PageData object by the HTTP referrer. If it's empty you will get press release rendering as the worst case.
I tried lots of solutions, including the adding of querystring to the PR items in the list links, the getting of referring url in the item template and different types of event hooking for automatic publishing of news items from a PR item (although I only looked at the code samples for that one), and finally came to the conclusion that they all had something that told me not to go that way. (Making the code too complex, or the markup logic too hard to understand and so forth)
I ended up using Fetch data from another EPiServer page, and creating a "shortcut pagetype" in which I let my editors pick which PR item should be used as base for a news item.
This shortcut pagetype is called "PR-as-news-itemPage" and it is rendered with the same aspx as ordinary news items: News-Item.aspx. Having no properties of its own, it will take all relevant data from the PR item selected with "Fetch..."
To render PR items with all its properties I created an ordinary new pagetype called PR-Item.aspx. This renders the "Attribute 2" property, which is only rendered by PR-item.aspx, and not by News-Item.aspx.
(I could have gone even simpler, by letting the editors use the old News-Item page type and use the "Fetch..." property there, but I have some mandatory properties in that page type which I didn't want to make optional for this sake.)

Resources