-
Notifications
You must be signed in to change notification settings - Fork 4
Customizing the layout
If you have created many links under multiple link categories, you might not want to display all of these categories on the same page on your site. Link Library provides a number of options to be able to select the categories to be displayed.
The [link-library] and [link-library-cats] shortcodes have a number of parameters that can be used to tailor the output that they will generate. For category selection, the shortcodes of interest are as follows:
| Parameter | Functionality | Example |
|---|---|---|
| categorylistoverride | Can be used to select the categories to be displayed, in the form of a comma-separated list of category ID | [link-library categorylistoverride="1,3,7"] |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
[link-library-cats categorylistoverride="1,3,7"] excludecategoryoverride Specifies the categories that should not be displayed by the shortcode, in the form of a comma-separated list of category IDs [link-library excludecategoryoverride="12,14"] [link-library-cats excludecategoryoverride="12,14"] By using these parameters with the [link-library] and [link-library-cats] shortcode, you only need to define your library settings once for all aspects of presentation of your links, and then only select which categories appear in each place. Then, if any changes are needed, there is only one place where these changes need to be made.
The category IDs for links are not displayed by default in the WordPress administration pages. To see them easily, install a plugin to display category ID, such as Reveal IDs
Multiple libraries A second approach to displaying lists of varying categories on different pages or posts is to create multiple library, each configured to display one or more categories. This approach can work well when you have a few groups of links to be displayed on a few pages, but it does not easily scale.
To use this approach, you must:
Configure a first set of library settings to display your links as desired Go to the plugin General Options page and increase the Number of Libraries from the default value of 1, then Save Settings Go to the Library Settings page Select the Library that settings will be copied from in the Select Current Library Settings drop-down list at the top of the page Select a target library in the Copy From: drop-down list on the right-hand side Press the Copy! button to create a duplicate of the original settings Select the Categories to be displayed using the selection list in the Common tab in Library Settings Insert the [link-library] shortcode with the settings parameter to select the library that should be displayed in this location (e.g. [link-library settings='2'] The main thing to keep in mind when using this method is that any subsequent changes to the library display configuration will need to be done for each library if they are all to keep being displayed the same.
Showing one category at a time While the category selection section shows how to select one of more categories to display on a page, this section explains how to display a list of link categories, followed by a single category at a time. To use this technique, you must first start by having the [link-library-cats] on a page, along with the [link-library] shortcode on the same page.
With this in place, you need to choose the type technique to be used to switch between categories.
AJAX Category Switching Method Activation Under the Library Settings page, select the Common tab Check Only show one category at a time checkbox Select AJAX as Switching Method Description In this mode, clicking a category name in the list will refresh the list of links using AJAX. This means that only the list of links will refresh on the page, leaving everything else as is.
Pros Fast refresh of links Does not need to reload entire site. Especially good if there are a lot of components on page (ads, videos, etc…) Cons Navigating from one category to the next does not update the link in the address bar, making it impossible to send a link to a specific category HTML GET, HTML GET with slugs and HTML GET with category names Switching Methods Activation Under the Library Settings page, select the Common tab Check Only show one category at a time checkbox Select HTML GET, HTML GET using slugs or HTML GET using category names as Switching Method Description In this mode, clicking a category name will visit a new page, with the page URL containing the numeric ID of the category to be visited. This means that the entire site will get reloaded as a visitor navigates the various categories available. Depending on the switching method, links will look as follows:
Options Example URL HTML GET http://test.nayanna.biz/links/?cat_id=2 HTML GET with slugs http://test.nayanna.biz/links/?cat=podcasts HTML GET with category names http://test.nayanna.biz/links/?catname=Podcasts Note that the difference between the last two is subtle in this example, but could be quite different if slugs are manually modified by the site admin.
HTML GET + Permalink Activation Under the Library Settings page, select the Common tab Check Only show one category at a time checkbox Set the Switching Method to HTML GET + Permalink Check Enable Permalinks Enter the URL of the links page (e.g. ‘links’), in the Permalinks Page field Save Settings Go to Settings | Permalinks Save your Permalinks settings Description Using Permalinks is the most complex setup that can be put in place to view different categories of links. That being said, it also allows users to have the cleanest links. When using this method, your links will look like:
http://test.nayanna.biz/links/podcasts
Category target address By using the Category target address, located under the Categories tab of the Library Settings page, you can actually separate link categories and links onto two separate pages. The category target address should be the full http:// address of the target page.
Unordered list versus table
Link field selection and ordering The way to select what will be displayed is to go to Library Settings section and click on the Advanced tab. There, you will see a table of all of the information that can be displayed about links.
2019-02-04 07_01_17-Link Library - Configurations ‹ Yannick's Corner — WordPress
For example, to activate the image, click on the Display checkbox next to Image. To see the description, check the display box next to Link Description.
The other fields for each row allow you to specify HTML code that will be displayed before and after the element in question. Some items like Image also have a few other configuration fields. There are tooltips in most of these fields to guide you in filling in this table.
If you want to change the order in which items are displayed (e.g. image before or after the link), you can re-order the items by drag-and-dropping the colored boxes at the top of the page and saving options.
Using category icons To display icons next to the names of categories when using the [link-library-cats] shortcode, you need to assign the icon by setting the category description to something like this:
400px-CategoryEditor
and then make sure that the option “Show Category Description” is checked on the Categories tab of Library Settings. You can also choose if the category description will appear before or after displaying the category by using the dropdown Position selector.
800px-LinkCategoryImages
A similar configuration is available under the Links tab of Library Settings to display the category description, and any image that it may contain, next to category names when display the links.
Stylesheet editor Hiding category names Link ordering Link Images and Thumbnails Collapsing links Advanced Features Shortcode parameters To override the settings specified inside of the plugin settings page, the [link-library] and [link-library-cats] commands can be called with options. Here is the syntax to call these options:
[link-library-cats categorylistoverride=”28″] Overrides the list of categories to be displayed in the category list [link-library-cats excludecategoryoverride=”28″] Overrides the list of categories to be excluded in the category list [link-library categorylistoverride=”28″] Overrides the list of categories to be displayed in the link list [link-library excludecategoryoverride=”28″] Overrides the list of categories to be excluded in the link list [link-library notesoverride=0] Set to 0 or 1 to display or not display link notes [link-library descoverride=0] Set to 0 or 1 to display or not display link descriptions [link-library rssoverride=0] Set to 0 or 1 to display or not display rss information [link-library tableoverride=0] Set to 0 or 1 to display links in an unordered list or a table. Change access for users to be able to add and edit links Here is how you could give access to authors to add or edit links:
Install and activate the User Role Editor plugin Under the Users menu, go to the User Role Editor Next to ‘Select Role and change its capabilities’, select Author Check the box labeled ‘manage_links’ Click the blue Update button on the right side of the capabilities list Your authors should now have access to the link manager. RSS Feed To publish an RSS feed of your links, go to the RSS Feed tab of Library Settings and check the box ‘Publish RSS Feed’.
Doing this adds an extra field to your web page header that browsers will be able to key on to offer the ability to view or subscribe to the RSS Feed.
The address of the feed is going to be: http://mywebsite.com/feed/linklibraryfeed?settingsset=1
Where the number after settingsset corresponds to the library settings number. You can use this address to create a link or button for visitors to easily subscribe.
Reciprocal Links The Reciprocal link checker is a tool that can be used to partially automate the task of looking on remote sites for a link back to your site when creating link exchanges. In these situations, you place a link on your site to a third-party web site in exchange for them placing a link back to your site on theirs.
Instructions To use this feature, you must perform the following steps:
Make sure that all links that are to be checked have been assigned a Reciprocal Link in the link editor. The address in that field should indicate the address of the page where a link back to your site is expected to be found. ReciprocalLinkEditor
On the Reciprocal Check page, set the Search String to the URL of your site (or any other string of text) that the checker should be looking for Save settings to save the Search String Click on Check Reciprocal Links button to launch check to get a report of all links, mentioning if they are properly linking back to you ReciprocalSettings
WARNING: If you get pages reporting that they are not linking back to you when you know for a fact that they are, then you should check the address of the site and make sure that it is not getting redirected. A redirect message will throw off the check. you can verify this by entering the URL in your browser and making sure that the URL does not change before displaying the actual page. For example, if you visit ign.com, you get redirected to ca.ign.com. The address to be set in the reciprocal link field should be ca.ign.com.
Automatic deletion option You can optionally check the option to automatically delete any site that returns a 403 error. These are sites that no longer exist or cannot be reached at the time of the check.
Using Permalinks *** NOTICE: Before trying to use Permalinks, you need to have Permalinks enabled on your site ***
Similar to the way Permalinks work in WordPress, Link Library can support permalinks to let you create a list of link categories on one page and then display lists of links on another page, with nice URLs that show the category name. For example, mysite.com/links/first-category. In addition to getting such nice URLs, using Permalinks has the additional advantage of only requiring you to create two pages: one to list the categories and the other one to display the links. Link Library will then handle reading the category from the URL and displaying the correct category of links on the page. Follow the steps below to activate Permalink mode in Link Library.
In the Common tab of Library Settings:
Check the option Only show one category at a time Set the Switching Method to HTML GET + Permalink Check the Enable Permalinks box Set the Permalinks page address (e.g. for mysite.com/links, type links in the Permalinks Page field) Once this is done:
Put the [link-library-cats] shortcode on a page Put the [link-library] shortcode on the page specified in the Permalinks Page field. You should then be up and running. All categories that you click on will direct you to distinct URLs and there is only a single page created.
Support for other link types (e.g. file://) To configure Link Library to accept types of links other than http or https links, go to the General Settings tab and look for the field called Additional Protocols. Set the value of this field to file and save options.
Importing links Import/Export Settings General Configuration