Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-23 09:33:42

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Simple tables in TxP (Ctrl+C, Ctrl+V)

Version 0.3 download link / homepage

Summary

Insert a table in TxP article is very simple! Select in Excel, IE, Mozilla, FireFox, Opera any spreadsheet, Ctrl + C (copy) and Ctrl + V (paste) in TxP Edit area. Add aks_table tags – that’s all.

Note: plugin support only simple table. (rowspan and colspan – unsupported).

.

See Example

Last edited by makss (2016-01-16 16:35:11)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#2 2009-04-23 11:05:47

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Nice idea, may come handy in some cases… I’ll give it a try, thanks!

Offline

#3 2009-04-23 11:17:19

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,540
Website GitHub Twitter

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Really awsome job, i have asked for that before, cause it s really anoying to insert big table manually, even if i use a text editor to convert tab to |, the plugin is much easier to explain the manner to insert table into textpattern.

Offline

#4 2009-04-23 15:34:18

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Very useful, thanks!!!

Offline

#5 2009-10-24 17:26:26

Ldx
Member
Registered: 2009-10-24
Posts: 15

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Hi makss, thank you for your simple and very useful plugin.

I’m having some troubles with (X)HTML validation of the generated code: the generated table is wrapped in a “@<p>@” tag and that’s not valid “XHTML 1.0 Transitional”. In fact, validator.w3.org says something like:

document type does not allow element "table" here; missing one of
"object", "applet", "map", "iframe", "button", "ins", "del" start-tag

	<p><table class="classname"><tr><td>(content)</td> ...

(...)

One possible cause for this message is that you have attempted to put a block-level element
(such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

In fact you can see the <p> tag prefixed to the <table> tag.

I am quite new to TXP and plugins, but anyway I tried to modify your plugin by returning on the last line something like:

return doTag($out, "table", $className);

But it still outputs the “p” tag wrapping the “table” tag. Probably I am not enough good with TxP and its plugins… :-)

The only solution I found so far is to start the <mks_table> line with a blank space, so preventing the generation of the “p” tag, but this is quite unelegant and prone to be forgotten, especially when others have to write and manage the articles with tables.

Do you think I am doing something wrong or maybe the plugin can be improved this way?

Kind regards
Aldo

Last edited by Ldx (2009-10-24 17:28:50)

Offline

#6 2009-10-24 18:44:35

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Ldx wrote:

Do you think I am doing something wrong or maybe the plugin can be improved this way?

It’s intended behaviour. Textile, that is used inside articles, automatically wraps new paragraphs inside paragraps, if not told to otherwise (like for example starting the line with whitespace or using notextile.).

Offline

#7 2009-10-24 18:49:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Gocom wrote:

(like for example starting the line with whitespace or using notextile.).

Or turn Textile off for that article (under Advanced options).

Offline

#8 2009-10-24 19:04:17

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,311

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Or, more generally solved, wrap <txp:body /> with Gocom’s excellent rah_replace:

<txp:rah_replace from="<p><table>,</table></p>" to="<table>,</table>">
	<txp:body />
</txp:rah_replace>

makss, like Aldo/Ldx says, thinking of the space is a little error prone as is remembering putting the aks_table tags around each article. If the aks_table tags needed to be put in the article form authors could post more careless. Is it possible to reorganize the code a little to achieve this?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#9 2009-10-31 22:16:57

Ldx
Member
Registered: 2009-10-24
Posts: 15

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

Thank you all for the answers. As far as I understood, the plugin cannot be responsible for the “p” tag that is put in place by Textile.
The “rah_replace” plugin is interesting (thanks uli!), but I am wondering if using such a plugin on a quite loaded server can slow down performances, since it has to scan all HTML code of each page served.

Offline

#10 2009-11-18 09:53:25

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

uli wrote:

makss, like Aldo/Ldx says, thinking of the space is a little error prone as is remembering putting the aks_table tags around each article. If the aks_table tags needed to be put in the article form authors could post more careless. Is it possible to reorganize the code a little to achieve this?

+1 for this if it’s possible.

The type of client I would find this plugin most useful for isn’t the type of client I’d trust to wrap the txp tags correctly. I’m thinking – if you could apply the aks_table magic pre-output rather than on save it could be used with a glz_custom_fields textarea specified for tabular data, which would mean you’d be able to wrap the aks_table tags only where needed in your article logic.

I suspect that it would need a fairly major overhaul to work this way, but for me it would drastically increase the usability of this plugin.

Offline

#11 2009-11-18 21:52:22

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

New version aks_table v0.2

Changes:

  • Added space before <aks_table> tag, for disable textile.

YES, it’s possible! :)

Note: This feature work ONLY after save article in Write article tab.

Last edited by makss (2016-01-16 16:39:44)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#12 2009-12-14 14:01:23

Ldx
Member
Registered: 2009-10-24
Posts: 15

Re: aks_table : Simple tables in TxP (Ctrl+C, Ctrl+V)

makss, it works, thanks a lot! :-)

Offline

Board footer

Powered by FluxBB