2009-04-23 09:33:42

makss
Plugin Author
êta
From: Ukraine
Known languages: ru, ua, en
Website

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

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

Version 0.2 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 (2009-11-18 21:53:24)


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_meta | aks_header : Compress your pages on the fly

Offline

 

2009-04-23 11:05:47

Zanza
Plugin Author
nu
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

 

2009-04-23 11:17:19

Dragondz
Moderator
rho
Real name: Rabah
From: Algérie
Known languages: French, Arabic, English(little), Amazigh
Website

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

 

2009-04-23 15:34:18

PascalL
Member
zêta
Real name: Pascal
From: Switzerland
Known languages: french, english
Website

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

Very useful, thanks!!!

Offline

 

2009-10-24 17:26:26

Ldx
Member
beta

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

 

2009-10-24 18:44:35

Gocom
Developer
omega
Real name: Jukka Svahn
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.).


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

 

2009-10-24 18:49:08

Els
Admin
omega
Real name: Els Lepelaars
From: The Netherlands
Known languages: nl, en, (some: de, fr, es, it)
Website

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).


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

 

2009-10-24 19:04:17

uli
Moderator
omega
Real name: Uli
From: Cologne/Köln
Known languages: de > en

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

 

2009-10-31 22:16:57

Ldx
Member
beta

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

 

2009-11-18 09:53:25

pieman
Member
lambda
Real name: Stuart Charlton
From: Bristol, UK
Known languages: Mackem
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

 

Powered by FluxBB