This article is for Account Owners and Project Managers using the Global Delivery Network.
The Smartling Global Delivery Network (GDN) mirrors the content available on your source site on your localized site. There may be cases where certain content on your source site does not make sense to display on any localized sites. For example:
- You have physical business locations in your source language location, but not in other markets.
- Your website's career page has positions available only in certain markets.
- You want to completely hide certain menu items, offers or features from your localized sites.
If you are looking to hide or display different content on some but not all of your localized sites, consider using Content Swaps.
Remove Content from Page Rule
Smartling offers an interface that allows you to configure certain GDN behaviors like content capture, translation, and visibility. If the content you want to hide from your localized sites is tied to a unique HTML class or ID, you can use a "Remove Content from Page" rule to target these elements. To add this rule:
- From your GDN project, click the Settings tab > Rules.
- Click on the blue "Add a New Rule" button for either a Class or ID and select "Remove Content from Page."
You can then enter your Class or ID name in the text box. Any time Smartling sees the provided class or ID in your HTML code, it hide the content on all localized sites.
Applying a Hide Class
You can add the "sl_hide" class directly to your on-page HTML to hide parts of your site.
Let's say you want to hide the "Stores" item from a navigation menu. The markup might looks something like this on your source site:
Add the "sl_hide" class to hide the Store menu item:
The resulting HTML on your localized sites will be rendered as follows:
Hiding Content with Comments
While using classes is the recommended method of hiding content, comments are useful when hiding meta content in your page headers. You can add Smartling comments directly in your HTML to hide content. For example:
This will hide the content across all localized sites.
The Hide feature allows you to hide an element within a page on a localized site, not entire pages. If you are using the Hide feature to remove a menu item or button, the linked page will still exist on your GDN site. Consider implementing a redirect on your web server or use information passed in Smartling headers to determine if a page should be served to a user visiting a translated site.
Excluding Paths With The GDN Crawler
If you use the GDN Crawler to scan your website on a schedule, you can exclude specific page paths within a domain by inserting the path in the excludes field.