I'm new to umbraco and using umbraco 6 latest version... Actually this is a silly mistake but makes me curious..
I've two content, let's say item a and item b.. This two item will be published alternately. so it can be access via "mysite/item_active"..
Today -> item a -> change name to item_active -> save publish -> change yesterday item active to item_b..
But somehow I forgot to use save publish yesterday.. And only click save that make the url of the content is not being updated..
Then how umbraco will choose with item to render (both item now have "mysite/item_active" url)?
The day I asked you is holiday until monday.. And I don't have access this site (because this internal company site) from home..
Are based on node? the smaller node is the one being render or the latest publish item will be rendered?
Umbraco won't allow you to save and publish two items with the same URL / node name (on the same tree level). It will automatically add version number e.g. (1) for the next node with the same name and then, friendly URL will become /mysite/item-active-1 in your case.
I tested this scenario, and Umbraco returns this information when you're trying to publish item with the same name as existing one:
So, in theory - we have two items published, but only one is still in the XML (IPublishedContent) cache, from which Umbraco is taking content first. Second item won't be visible until we will change the URLs / names to be different or perform publish on first item and then scenario described at the beggining will be applied.
Maybe it's worth to consider having it as a same page and just swaping the templates on which you can render particular properties values? Or having a content picker or something else to determine which version of the site should be marked as active and used?
Related
I am trying to find the correct template and id to use for a hotprint of an advanced pdf template of an Item Fulfillment.
The hot print url is (with the id bolded) https://system.na3.netsuite.com/app/accounting/print/hotprint.nl?regular=T&sethotprinter=T&id=7600&label=Packing%20Slip&printtype=packingslip&trantype=itemship&orgtrantype=TrnfrOrd&auxtrans=7605
For some reason only certain id=# seems to affect the outcome and the ids I have got to work for two different templates don't match the Custom Transaction Forms ID or the Advanced pdf script id. (example most ids=template 1, while 168,4954, and seemingly random other ids=template 2) I am very confused on how netsuite resolves the hot print url as it normally doesn't include the template= part though I have seen others use it for invoice print urls.
The parameters at the end of the url (the stuff after the ?) are used by Netsuite to control settings used by the webpage which prints the PDFs for you.
In this case, &id=##### refers to the internal id of the document you are printing. You can see this by going to the document, right clicking, selecting inspect, and typing nlapiGetRecordId() into the console. When you click Print, you should see that same number after &id=#####.
&template=### refers to the template you are printing. If you go to Customization -> Forms -> Advanced PDF/HTML Templates, you'll notice a Script ID field in the table. If you substitute the correct Script ID in for the number in &template=###, you'll notice you generate the same PDF. This Script ID acts the same as the number that was previously there.
The reason you're seeing unusual results when you change those numbers is because you're mismatching a record with a template not built for it. So it won't print exactly right, but will sometimes execute anyways.
Anyways, this sort of parameter scheme is a similar scheme to how Suitelets and Restlets work, so in the future, you might experience this sort of thing again.
EDIT: For those reading this in the future, please read the comments.
To customize a packing slip and return form:
If you are printing packing slips and need some customization, you can use a custom invoice form when printing packing slips. For example, you can customize an invoice form to hide the fulfilled item tax rate and amount, and the order total. Then, when you print the packing slip using the custom form through mass print, choose the the packing slip shows the customized information.
My content tree goes somewhat like this
Articles
2016
1
Article 1
2
...
2017
1
Article 1
2
...
Is there any way to make Umbraco pick unique URL names for "article 1"?
As for no it gives me "/articles/2016/1/article-1" and "/articles/2017/1/article-1" which by itself is not wrong.
But I would rather have it do like "/articles/2016/1/article-1" and "/articles/2017/1/article-1-1".
The reason for this, is that I'm currently suppressing the year and month in the URL's, but would like to maintain the tree structure in the backoffice.
Nope, not out of the box. By default, the Umbraco UI will ensure unique naming of pages AT THE SAME LEVEL.
So if you already have a page called "Page 1" and try to add one of the same name at the same level, Umbraco will automatically rename it "Page 1 (1)".
It doesn't check the rest of the site though, just the level that you're adding the content on.
To accomplish what you're after, you'd be looking at some kind of event handler on the content service or something similar, and check there for other nodes with the same name at any level.
I am fairly new to Umbraco and I am wondering where I should put pieces of random data.
I have a lot of experience with Sitecore, used it for several years, I am certified etc etc. But now I have to build something with Umbraco. At a first glance Umbraco looks inferior to Sitecore in every way, but I might be wrong about that.
So what I am wondering is, where should I put non-browsable pieces of data that are visible on several places throughout the website? I'd like to create data items in Umbraco for things like Testimonials, Offices? I'd like to have a centralized place in Umbraco where they can be maintained and reference them from a page node. But the way it looks now is that everything has to be on the page node. Which is sort ok, for your average family webpage.
Could someone please shed some light on this?
You could create another node under the man content and call it site settings and store them there that way all pages under the home page are just visible pages on the front end and all data nodes are in a separate area.
There is one property in umbraco that you can add to document types and name it "umbracoNaviHide" (for alias, the name can be anything). This allows wires in automatically to the .IsVisible() method.
var children = Model.Content.Children.Where(x => x.IsVisible());
I find this situation to be very frequent, think of slideshows. When I make an Umbraco website, under my root node I normalle havea Slideshow document type (that contains slides) and I programmatically traverse those to build the slideshow on the home page for example. This Slideshow document has that "umbracoNaviHide" property and I skip it from my menus either using the .IsVisible() method or by manually skipping specific document types.
var menuItems = Model.Content.Children.Where(x => x.DocumentTypeAlias != "Slideshow" && x.DocumentTypeAlias != "Search");
On the other hand, if you are looking for "labels", you can look at "Dictionnary" items under the "Settings" tab.
To directly answer your questions, I reccomend putting non-browsable pieces of data as children of the relevant browsable content node. (But there are other valid ways to do this, it really is up to you and what's best for your content editors.)
Hope this helps.
As you may know, if you have products that share a url key, the url key will have a digit appended to it:
i.e
http://www.example.com/main-category/sub-category/product-name-**6260**.html
How do I find the source of that 6260 (which is one of the #'s appended to my urls)? I tried product id, sku, I cannot find the source of it. The reason I ask is because if I can find it, I can create a string replace function to flush it out of url's before I echo them on certain product listing pages.
Thanks.
Before we get to the location in code where this happens, be advised you're entering a world of pain.
There's no simple rule as to how those numbers are generated. There's cases where it's the store ID, there's cases where it's the simple product ID. There's cases where it's neither
Even if there was, it's common for not-from-scratch Magento sites to contain custom functionality that changes this
Ultimately, since Magento's human readable/SEO-friendly URLs are located in the core_url_rewrite table, it's possible for people to insert arbitrary text
Warnings of doom aside, the Model you're looking for is Mage::getSingleton('catalog/url'). This contains most of the logic for generating Magento Catalog and product rewrites. All of these methods end by passing the request path through the getUnusedPath method.
#File: app/code/core/Mage/Catalog/Model/Url.php
public function getUnusedPath($storeId, $requestPath, $idPath)
{
//...
}
This method contains the logic for for creating a unique number on the end of the URL. Tracing this in its entirely is beyond the scope of a Stack Overflow post, but this line in particular is enlightening/disheartening.
$lastRequestPath = $this->getResource()
->getLastUsedRewriteRequestIncrement($match[1], $match[4], $storeId);
if ($lastRequestPath) {
$match[3] = $lastRequestPath;
}
return $match[1]
. (isset($match[3]) ? ($match[3]+1) : '1')
. $match[4];
In particular, these two lines
$match[3] = $lastRequestPath;
//...
. (isset($match[3]) ? ($match[3]+1) : '1')
//...
In case it's not obvious, there are cases where Magento will automatically append a 1 to a URL, and then continue to increment it. This makes the generation of those URLs dependent on system state when they were generated — there's no simple rule.
Other lines of interest in this file are
if (strpos($idPath, 'product') !== false) {
$suffix = $this->getProductUrlSuffix($storeId);
} else {
$suffix = $this->getCategoryUrlSuffix($storeId);
}
This $suffix will be used on the end of the URL as well, so those methods are worth investigating.
If all you're trying to do is remove numbers from the URL, you might be better off with a regular expression or some explode/implode string jiggering.
I have little to no idea why this works but this worked for me. Most probably because it makes urls non-unique. Magento ver. 1.7.0.2 had suddenly started adding numbers as suffixes to my new products' names, even if their url keys and names were different from the old products. On a hunch, I went to System -> Configuration -> Catalog -> Search Engine Optimizations -> Product URL Suffix and changed the default .html to -prod.html. I guess you could change it to any suffix you wanted to. Then I re-indexed my website, refreshed cache, and presto! All the numbers were gone from the product urls. The product urls now all have the format custom-product-name-prod.html. The canonical tag also shows custom-product-name-prod.html so I'm double happy.
Don't know if it'll work for others, but I hope it does. Do note that I did have old and new products with duplicate URLs and that I had disabled old products before doing this procedure. So if you have 2 products with the same url key and both are enabled, then this may NOT work for you.
There's a problem! As you look in the edit product you can see the link is correct but on your store the url is different.
Step 1: Edit the URL and add SS to the end of the custom url. Press
Save. \product-namess.html
Step 2: Go to Catalog -> URL Rewrite
Step 3: Narrow Down the Criteria to Include Only The Problem Situation.
Press Search.
Step 4: Download Jib Bit Mouse Recorder / Macro
Recorder. Its Free I pay.
Step 5: Edit the First Rewrite. Press
Delete and OK.
Step 6: Press Record on JitBit. Edit the 1st Rewrite.
Delete. OK. Press Stop.
Step 7: Drop Down Next to Play Select X
Times. Write the Number of Records. Press OK.
Step 8: Watch the
Program Delete All the Records for You.
Step 9: Catalog -> Manage
Products. Remove the SS from the end of the custom URL. Do not check
create redirect. Fixed.
Mine was 279 records of changing that product. So it took about an hour.
I am developing a workflow which involves a chain of tasks. This chain is started atomatically on the creation of a specific list item. The workflow creates a new "readonly" list item in another list to hold all the information and creates a new task item to collect more info. This new task then updates the "readonly" list item with its new data and creates the next task in the chain.
The initial list item can have attachments. How can I transfer or otherwise link these attachments to the new readonly list item ?
I only have sharepoint designer and cant implement this in code due to corporate IT restrictions. (or can I?)
Ok well I have a plan and nobody has even looked at this question yet.
I will edit the NewForm.aspx and include javascript to capture the fileupload fields in a PreSaveAction. Then call updateListItems Web Service with javascript to create items in an Attachments list. Creating these items triggers a workflow that concatentaes the attachment names together with the URL of the attachment directory for the original list. Then all I need to do is grab the Id from the original list item when its created and add that back into the concatenated links to finish them.
Then each task in the chain can pull out the concatenated list of links back to the original attachments.
easy
Lets see how it goes!
Anybody any other ideas?