I am writing a reaction rule that responds to a Feeds import which creates nodes of type stub_node_feeds. I want to copy the title and a couple of fields to a new node of content type stub_node. I cannot figure out how to create a new node (is this an Entity of type Content?) using Rules. The "Create a new content" action seems appropriate, but it is not working for me.
Any advice would be appreciated.
I discovered the solution to my goal in a different module, CSV Importer. This module can import content entities, menu items, taxonomy terms, and users using data in .csv files. It does not attach itself to any of these entities, and so is the exact solution I needed.
Related
I'm new to Sitecore XP 8.2 and try to study by articles and youtube.
However, I can't figure out why we should use datasource, instead of having multiple items in the content tree? How can I enable Global on the content tree?
If you by 'datasource' means 'Rendering Datasource Location' heres a real life example, where using datasource is helpfull, instead of having data items underneath each page item.
Lets say, you have a Footer module, which you would like to include on all content pages in your website. And the Editors should be able to change the content of the footer module on all pages, but the effect should be global.
In this case, could a solution be, to make a folder at the top of your tree structure called 'Shared Modules', and point the 'Footer Rendering Datasource Location' at this folder.
In case an editor changes the footer text on the main page or a subpage, the effect will allways be saved in the same location.
unlike, a 'Texbox module' which you would like to have multiple of on multiple pages. these would you like to have placed underneath each of your content pages in a folder e.g 'Page Modules'.
You can use Sitecore Datasource for a variety of reasons. One of the reasons is to use this instead of context item so that you can refer to another item in Sitecore content tree. Another good reason is to personalize your content or run the A/B testing, content testing. Using Sitecore datasource, make different parts of page componentize and all this helps content editor to improve experience in content editor.
For some good information on using Sitecore datasource, you can look at
https://www.linkedin.com/pulse/how-improve-experience-editor-sitecore-number-ways-rohit-chopra
https://www.linkedin.com/pulse/sitecore-personalize-content-conditional-renderings-sub-rohit-chopra
In short, with datasources you can re-use your items, makes your life much easier if you want to go with personalization and its easier to manage in terms of security/workflows.
A datasource is a pointer from your presentation to a content item. This item can easily be picked from a global or local placement in the content tree. You can still navigate from the datasource to other items (like subitems) if you want a more complex structure for your content.
The advantages of using datasources, is that Sitecores presentation engine, Experience Editor and marketing/personalization is based on the usage of datasources. Further you cater for reuse of content, as multiple presentations can point to the same datasource item.
By using datasources you decouple the content from the structure of your content tree and hierarchy.
I'm coming from a Kohana background and have asked a couple of questions pertaining an issue I'm having and need to find out how to get this done. I am VERY new to Symfony and Doctrine and love learning new frameworks and correct ways to code. However I'm finding Doctrine ORM frustrating to use yet powerful.
So here is my basic issue and I'll try to be brief. I have a products table and a products_images table. By following the tutorial for Symfony I am already able to create Entities for both and map the relationships, generate getters and setters, create Repositories, and the whole bit. But here is where it gets sticky...
The product_images table only contains the name of the image, not the path, which I will obviously need if I am going to construct and useful href in my html. The products table was populated with products by crawling over the web and obtaining them in that method and as a requirement by the persons that are having me write their website, I am required to keep the images separated into directories that represent where they were crawled from. The location of the images has been changing often so I DO NOT want to store the path in the database.
So to keep my question simple what I need to do, somehow, some way, is to write some logic that examines where the image was crawled from and then construct a path string to pass along to my twig template and then append the image name...all in order to create a valid image tag or href.
My last attempt to find a solution for this was to modify the getter for the image name in the Entity but since I am using createQueryBuilder() to perform some DQL, it appears the getters aren't being used and now I have nothing to go on. I cannot find any documentation on the official Doctrine website that helps me get around this issue and I just need to know how to overcome this. Can anyone help?
if path is static, doctrine has nothing to do with your problem, you can use a constant or a parameter to define it.
then you jsut have to add a getter
getImageWebPath() {
return self::PRODUCT_WEB_PATH. $this->getImageName();
}
If the image is stored in a parameter you can use a lot of tools: twig function wich append the path before your image name, services wich set the path to your entity or directly getting twig parameter... etc
I am creating a Sitecore MVC site for a client and I need to create page that will list news articles for the company.
So far, I have created items that use a shared data template called “Article,” and I also have a sublayout (a view rendering) called “Article” that will display these items.
For the list itself, my plan was to create another component (a sublayout) call “News_List”, and to put a placeholder in it called “List”.
My question is this: can I allow the author to insert articles (e.g., N items of type “Article”) into this placeholder via the page editor?
Will SC allow you to insert multiple instances of the same component into a placeholder? Will this break anything?
I believe this is a pretty common question but I have not found a definitive answer. Thanks in advance…!
You can insert as many components (of the same type) in your placeholder as you want.. Just make sure to put the placeholder settings correctly and give it a decent name (not just "list" ;))
But are you sure you want to do this? Your editors will manually need to create a list of components for each article they want to add on the page. Doesn't sound to be very user (editor) friendly.. Maybe you should consider creating a list component that can get a list of articles as a datasource and show those. Or even select them automatically (but that might be not according to your business case)..
Yes, authors can add multiple instances of the same component into a single placeholder.
Assuming that the code of the component doesn't do any stupid things it's absolutely ok to do this.
I'm having problems figuring out the best way to model the following relationship with Django.
I currently have a Site model as the main model that everything else attaches to. A Site is made of two basic building blocks: ModuleSlots and modules. A ModuleSlot is something that a module (which I'll describe in just a second) can be attached to.
Then I have a model called ModuleBase, which is the base model for modules that can be attached to site's moduleslots. A module is a self-contained piece of site that is itself functional – it doesn't know anything about the outside world. The ModuleBase model is meant to be inherited to create new modules – example modules are a Poll module and Content module. The point is, I want to have the ability to define new kinds of modules in the future, so that's why I went for the base-class approach. The picture below may better describe what I just wrote.
Now, I want to bring time into this scheme – ModuleSlot's content should be timeable, meaning that the module AND the attached poll/content/etc. should be able to change at the same, pre-defined time. For example, let's say that a ModuleSlot is currently tied to Content module. I want the ModuleSlot to change to point to a Poll module and show a spesific Poll. This all should happend automatically at spesific time.
How should I present this kind of relationship? I'be been giving this some though and this is what I have so far: I think I should create some kind of GenericContent model that is then inherited by individual content types that the modules define, eg. Poll of the PollModule would inherit from GenericContent, and Content of the ContentModule would do the same. I should also introduce TimeSpan for the ModuleSlot. Then, in the backend, I could check every minute if a ModuleSlot needs an update, and do the update if the module and attached content should be changed. What do you guys think? The messy picture below (may) describe the relationships described.
I'm not sure if the inheritance is the correct way to go here (GenericContent). I could also just store id of the Poll/Content/etc. in the ModuleSlot, as all my id's are the same type – since I know the module that is attached to a ModuleSlot, I can ask the Module for the content for the given id.
I've been doing a little tweaking of the SQL-side of ELMAH to provide basic logging capabilities to my MVC app.
I changed ELMAH_LogError to test the TYPE field for text sent by my App and, if found, inserts to a different table that i'd created by 'Script As'
It was reasonably easy to simply create a new table because I didn't try to rename any fields. The structure is identical to the original. Any chance this same principle (same structure/different table name) could be (easily) extended to providing a new 'Logger.axd' that would provide viewing of my newly created table?
thx