import_replacements
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| import_replacements [2014/01/29 18:04] – external edit 127.0.0.1 | import_replacements [2026/03/21 10:11] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Import Replacements ===== | ===== Import Replacements ===== | ||
| - | Rotation | + | In Rotation |
| - | This is very useful to remove\replace some text in import, for example | + | **Example 1: Adjusting embed size** |
| - | **Example 1** | + | Suppose xVideo embeds have width=400, but you need width=500: |
| < | < | ||
| - | xvideo has embedded cideos with width=400 | ||
| - | If this field = URL | + | If this field = URL |
| - | Contains this value = xvideo | + | Contains this value = xvideo |
| - | ie this rules works only if we have ' | + | Then Search For - width=400 |
| + | in This Field - embed code | ||
| + | And Replace it With - width=500 | ||
| - | Then Search For width=400 (what we have in original format) | + | </ |
| - | in This Field - embed code (width=400 is located in embedded code) | + | |
| - | And Replace it With - width=500 | + | **Example 2: Changing URL parameters** |
| + | |||
| + | An RSS feed provides URLs like http:// | ||
| + | |||
| + | < | ||
| + | |||
| + | If this field = URL | ||
| + | Contains this value = somesponsor | ||
| + | Then Search For - id=25 | ||
| + | in This Field - URL | ||
| + | And Replace it With - id=30 | ||
| </ | </ | ||
| - | **Example 2** | ||
| - | Let's say we have import like http:// | + | ==== EMPTY_VALUE ==== |
| + | |||
| + | Replacements support special meta tags for conditional field operations. For SEO purposes, you often need multiple descriptions for a single gallery. Instead of manually entering duplicate content, you can use meta tags to automatically copy and populate fields. | ||
| + | |||
| + | Available meta tags: | ||
| + | |||
| + | < | ||
| + | {DESCRIPTION}, | ||
| + | |||
| + | **Example: Populate empty Title from Description** | ||
| < | < | ||
| - | If this field = URL | + | |
| - | Contains this value = somesposnor | + | If this field = Title |
| - | Then Search For - id=25 | + | Contains this value = < |
| - | in This Field - URL | + | Then Search For - * (entire field) |
| - | And Replace it With - id=30 | + | in This Field - Title |
| + | And Replace it With - {DESCRIPTION} | ||
| </ | </ | ||
| + | |||
| + | This rule copies the gallery description into any empty Title field, automatically generating a second description for SEO purposes. You can adapt this to copy to other fields like URL or custom fields as needed. | ||
| + | |||
| + | |||
| + | < | ||
| + | |||
| + | special variable to indicate that the field contains only " | ||
| + | |||
| + | |||
| + | ==== ANY_VALUE ==== | ||
| + | |||
| + | Like EMPTY_VALUE, | ||
| + | |||
| + | ==== external:: ==== | ||
| + | |||
| + | This feature was originally designed for translations but works for any external processing of field values. You can call an external URL to modify imported data. | ||
| + | |||
| + | **Example: Randomly add punctuation to descriptions** | ||
| + | |||
| + | Create a PHP script at http:// | ||
| + | |||
| + | < | ||
| + | |||
| + | <?php | ||
| + | $rand_char = (rand(0, 100) > 50) ? ' | ||
| + | echo $_GET[' | ||
| + | ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | Then add this replacement rule: | ||
| + | |||
| + | < | ||
| + | |||
| + | If this field = URL | ||
| + | Contains this value = http | ||
| + | Then Search For - * (entire field) | ||
| + | in This Field - Alt (Title) | ||
| + | And Replace it With - external:: | ||
| + | |||
| + | </ | ||
| + | |||
| + | For each imported gallery, the script requests the URL with the actual ALT value. The script receives the response (description with added punctuation) and saves it to the Alt field. | ||
| + | |||
| + | **Example 2: Save processed data to a different field** | ||
| + | |||
| + | Use the same logic but save the result elsewhere: | ||
| + | |||
| + | < | ||
| + | |||
| + | If this field = URL | ||
| + | Contains this value = http | ||
| + | Then Search For - * (entire field) | ||
| + | in This Field - Description | ||
| + | And Replace it With - external:: | ||
| + | |||
| + | </ | ||
| + | |||
| + | Now the modified text is saved to the Description field instead of Alt. This flexibility lets you transform data in unlimited ways using custom scripts on your server. | ||
import_replacements.1391018665.txt.gz · Last modified: (external edit)
