Feature request: HTML in description; longer description field
-
2) link_description field in the links table in the MySQL database is too short (varchar(255)) sometimes. I changed it to TEXT without length (255) to import correctly old data from another php script, but probably php code should be modified too, because it verifies somehow length of description entered by submitter.
-
But on this forum, HTML code works, even
< and >
are recognized as
< and >:
< and >
So onece again:
1) HTML code, for example are replaced by their html codes.
Here is example workaround which worked for me, but perhaps it is risky or incorrect.
render-link-library-sc.php file – these lines:
$descnotes = esc_html( $linkitem[‘link_notes’], ENT_QUOTES );
$desc = esc_html($linkitem[‘link_description’], ENT_QUOTES);
can be replaced by
$descnotes = $linkitem[‘link_notes’];
$desc = $linkitem[‘link_description’];
(the same but without ENT_QUOTES)2) link_description field in the links table in the MySQL database is too short (varchar(255)) sometimes. I changed it to TEXT without length (255) to import correctly old data from another php script, but probably php code should be modified too, because it verifies somehow length of description entered by submitter.
Lower than and greather then are replaced even written as & … ; on this forum …
And they are also replaced in code blocks, what should not take place and looks like a bug in this forum script.So once more this way:
1) HTML code, for example [lower than]a href … can’t be used, because [lower than] and [greather then] are replaced by their html codes. So option allowing this is needed. Maybe for chosen links only.
Here is example workaround which worked for me, but perhaps it is risky or incorrect.
render-link-library-sc.php file – these lines:
$descnotes = esc_html( $linkitem[‘link_notes’], ENT_QUOTES );
$desc = esc_html($linkitem[‘link_description’], ENT_QUOTES);
can be replaced by
$descnotes = $linkitem[‘link_notes’];
$desc = $linkitem[‘link_description’];
(the same but without ENT_QUOTES)2) link_description field in the links table in the MySQL database is too short (varchar(255)) sometimes. I changed it to TEXT without length (255) to import correctly old data from another php script, but probably php code should be modified too, because it verifies somehow length of description entered by submitter.
(& … ; codes for lower than and greather than are recognized as HTML’s begin and end of a node marks on this forum ! Not only original lower than and greather than characters.)
The Large Description field addresses both of your concerns.
Changing the size of the description field would not make sense since that field is part of the core WordPress data schema and is not only used by Link Library, but also by other plugins that offer link management capabilities.
The Large description field is a multi-line field stored in a larger field in the links_extrainfo table that gets created by Link Library. That field also allows for HTML to be displayed.
Than you for your answer. I will try to use that second, larger and allowing use of HTML field.
Would you find time to answer one more question ?
1) Library Settings – Links – Show Category Description
makes the Link description visible (link_description varchar(255) column) in the submission form ?
2) Library Settings – User Submission – Large Description Label – Show
makes the Link Submitter Comment visible (link_notes (mediumtext) column) in the submission form. Probably this field you proposed to use for longer text and HTML.
3) the shortcode’s descoverride=1
makes description visible in the Link Library (webpage with list of links). For example:
[link-library descoverride=1 categorylistoverride=”46″]But how to make visible content of that larger field – Link Submitter Comment / link_notes (mediumtext) ?
in the Link Library (webpage with list of links)
In your latest set of questions:
1) Show Category Description does not show link description, it allows you to display the category description next to the category name when links are being printed. The category description could contain text describing the category, or an image tag or other html code, with [ and ] characters being converted to < and > brackets. You can read more about the use of this field here: http://ylefebvre.ca/wppluginsdoc/index.php/Using_category_icons
2) No, setting Large Description Label to Show displays the large description field in the user form. That field is stored in the field link_textfield in the database under the table link_extrainfo. It is the field I proposed you should use for longer text and HTML.
3) To display content of larger field, go to library settings, under the Advanced tab, and check the box next to Link Large Description in the table of fields that can be displayed.
Thank you for your patience.
> 1) Show Category Description does not show link description,
Not: Library Settings – Categories – Show Category Description
but: Library Settings – Links – Show Category Description
Perhaps “Show Category Description” is mistake in the label content.> 2) No, setting Large Description Label to Show displays the large description field in the user form.
This seems to be exactly what I meant (submission form)> 3) To display content of larger field … under the Advanced tab
Thank you. And there is an option
Convert [] to <> in Link Description and Notes
which actually makes possible use of HTML ! Because HTML code could be entered with greater then and lower then replaced by ] and [.
But so far I will use rather that smaller field.No, it probably simply makes possible to put greater then or lower than into final text.
1) When you set Library Settings – Links – Show Category Description, it should show the description of the Category when displaying LINKS with the [link-library] shortcode. The other one, Library Settings – Categories – Show Category Description, is to display the category description next to the category names when display the CATEGORIES using the [link-library-cats] shortcode. So both are related to category descriptions, not to link descriptions.
3) Ah, indeed. I forgot about that option. The reason I had to do this is because the note and link description short field will strip out HTML on submission. I do not have control over this code at the moment since it is from the core WordPress link management code.
The topic ‘Feature request: HTML in description; longer description field’ is closed to new replies.