Stai creando una tabella in stile amministratore?
-
-
C'è unnuovoblogper laguida di stile dell'interfaccia utente di WordPress,potrestitrovarlo utile.http://dotorgstyleguide.wordpress.com/outline/There is a new blog for the WordPress UI styleguide, you may find it helpful. http://dotorgstyleguide.wordpress.com/outline/
- 3
- 2010-09-27
- sorich87
-
Notaper se stessi: scribu ha aggiunto [unnuovo sistema ditabelle ajaxifiedin WP 3.1] (http://core.trac.wordpress.org/ticket/14579),con una classebase `WP_List_Table`.Questa domandapuòprobabilmenteessere aggiornata coninformazioni su come usarla.Note to self: scribu added [a new ajaxified table system in WP 3.1](http://core.trac.wordpress.org/ticket/14579), with a base class `WP_List_Table`. This question can probably be updated with information on how to use it.
- 2
- 2010-12-28
- Jan Fabry
-
5 risposta
- voti
-
- 2010-09-06
Questo è ciò che utilizzogeneralmente:
<table class="widefat fixed" cellspacing="0"> <thead> <tr> <th id="cb" class="manage-column column-cb check-column" scope="col"></th> // this column contains checkboxes <th id="columnname" class="manage-column column-columnname" scope="col"></th> <th id="columnname" class="manage-column column-columnname num" scope="col"></th> // "num" added because the column contains numbers </tr> </thead> <tfoot> <tr> <th class="manage-column column-cb check-column" scope="col"></th> <th class="manage-column column-columnname" scope="col"></th> <th class="manage-column column-columnname num" scope="col"></th> </tr> </tfoot> <tbody> <tr class="alternate"> <th class="check-column" scope="row"></th> <td class="column-columnname"></td> <td class="column-columnname"></td> </tr> <tr> <th class="check-column" scope="row"></th> <td class="column-columnname"></td> <td class="column-columnname"></td> </tr> <tr class="alternate" valign="top"> // this row contains actions <th class="check-column" scope="row"></th> <td class="column-columnname"> <div class="row-actions"> <span><a href="#">Action</a> |</span> <span><a href="#">Action</a></span> </div> </td> <td class="column-columnname"></td> </tr> <tr valign="top"> // this row contains actions <th class="check-column" scope="row"></th> <td class="column-columnname"> <div class="row-actions"> <span><a href="#">Action</a> |</span> <span><a href="#">Action</a></span> </div> </td> <td class="column-columnname"></td> </tr> </tbody> </table>
Spero che questo aiuti.
This is what I generally use:
<table class="widefat fixed" cellspacing="0"> <thead> <tr> <th id="cb" class="manage-column column-cb check-column" scope="col"></th> // this column contains checkboxes <th id="columnname" class="manage-column column-columnname" scope="col"></th> <th id="columnname" class="manage-column column-columnname num" scope="col"></th> // "num" added because the column contains numbers </tr> </thead> <tfoot> <tr> <th class="manage-column column-cb check-column" scope="col"></th> <th class="manage-column column-columnname" scope="col"></th> <th class="manage-column column-columnname num" scope="col"></th> </tr> </tfoot> <tbody> <tr class="alternate"> <th class="check-column" scope="row"></th> <td class="column-columnname"></td> <td class="column-columnname"></td> </tr> <tr> <th class="check-column" scope="row"></th> <td class="column-columnname"></td> <td class="column-columnname"></td> </tr> <tr class="alternate" valign="top"> // this row contains actions <th class="check-column" scope="row"></th> <td class="column-columnname"> <div class="row-actions"> <span><a href="#">Action</a> |</span> <span><a href="#">Action</a></span> </div> </td> <td class="column-columnname"></td> </tr> <tr valign="top"> // this row contains actions <th class="check-column" scope="row"></th> <td class="column-columnname"> <div class="row-actions"> <span><a href="#">Action</a> |</span> <span><a href="#">Action</a></span> </div> </td> <td class="column-columnname"></td> </tr> </tbody> </table>
Hope that helps.
-
è ancheper avere lapaginazione automaticainseritain questomodo?(ades.mostrandopost 1-20)is it also to have automatic pagination inserted like this? (e.g. showing post 1-20)
- 0
- 2011-12-07
- Michiel Standaert
-
@MichielStandaert No.@MichielStandaert No.
- 0
- 2014-06-14
- kaiser
-
@MichielStandaert se vuoi un risultatoimpaginatopuoi usare [paginate_links] (http://codex.wordpress.org/Function_Reference/paginate_links)@MichielStandaert if you want a paginated result you can use [paginate_links](http://codex.wordpress.org/Function_Reference/paginate_links)
- 0
- 2014-09-26
- tiltdown
-
Grazie !(Ma sto ancora chiedendoperchénon hanno usato `: odd`per rigainvece di aggiungere una classe ogni due righe ...)Thanks ! (But I still asking why they didn't use `:odd` for row instead of let us add a class each two rows ...)
- 0
- 2016-03-15
- Zachary Dahan
-
Ovviamente ci sono soluzioni "migliori" (come le altre risposte qui),maper unatabella velocee dibase,questo èesattamente quello che cercavo.Grazie!There are obviously "better" solutions (like the other answers here), but for a quick, basic table, this is exactly what I was after. Thank you!
- 0
- 2019-11-01
- rinogo
-
- 2012-12-19
Utilizza l'APIprincipale,non soloil suo CSS
Normalmente usi solo un'istanza della classe
WP_List_Table
.Guide:
- Maggioriinformazioni al riguardonel Codex qui .
- Ecco anche unaguida di WP Engineer :troppaper copiarla.
- E un'altraguida su Smashing Magazine online.
Vantaggi?
SÌ!
Puoi aggiungereimpaginazione,caselle di ricerca,azionie qualsiasimagiatupossaimmaginare (e chepuoi codificare).
Use the Core API, not only its CSS
Normally you just use an instance of the
WP_List_Table
class.Guides:
- More about it in the Codex here.
- Here's also a guide from WP Engineer - too much to copy it over.
- And another guide on Smashing Magazine online.
Benefits?
YES!
You can add pagination, search boxes, actions and whatever magic you can imagine (and are able to code).
-
Piccolo suggerimento come collegamentoper vederemarkup,classiper l'interfaccia di amministrazione,senza solo l'obiettivo di crearetabelle: https://github.com/bueltge/WordPress-Admin-StyleSmall hint as link to see markup, classes for the admin interface, without only the goal to create tables: https://github.com/bueltge/WordPress-Admin-Style
- 1
- 2013-11-04
- bueltge
-
> L'accesso di questa classe è contrassegnato comeprivato.Ciò significa chenon è destinato all'uso daparte di sviluppatori diplugine temipoiché è soggetto amodifiche senzapreavvisoin qualsiasi versionefutura di WordPress.Se desideri comunque utilizzare la classe,dovrestifarne una copia da utilizzaree distribuire coniltuoprogetto,oppure usarla atuo rischioe pericolo.>This class's access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk.
- 2
- 2017-05-20
- Austin Pray
-
@AustinPray _A copy_?No,perfavorenonfarlo.Sono disponibilibeta,RCe altrepre-release di WP.Aggiorna latuaimplementazione/estensione.Se devi davvero andare ditraverso,scrivi qualcosa dimeglio da solo.Il codice dibasenon è _quello_buono.@AustinPray _A copy_ ? No, please do not do that. There are betas, RCs and other pre-releases of WP available. Just update your implementation/ extension. If you really have to go sideways, just write something better on your own. The core code isn't _that_ good.
- 1
- 2017-05-20
- kaiser
-
@kaiser Non sparare almessaggero,non sonoparolemie.Stavo citando dal WP Codex.Anche seiscriversi atest di regressioneperpetui con ognibetae RCnon suonamoltomeglio che copiare la classe.Sono d'accordo che scrivere latua lezione semplice sia unmodomiglioreper andare avanti.@kaiser Don't shoot the messenger, those aren't my words. I was quoting from the WP Codex. Although signing yourself up for perpetual regression testing with every beta and RC doesn't sound much better than copying the class. I agree writing your own simple class is a better way forward.
- 0
- 2017-05-22
- Austin Pray
-
@AustinPray Nessun rancore :) Il codice è scritto dapersone comete eme.Ineffetti,puoi andare orae annullare questa affermazionee lagente la citerà.@AustinPray No hard feelings :) Codex is written by people like you and me. In fact, you can go now and revert that statement and people will quote it.
- 0
- 2017-05-22
- kaiser
-
Sfortunatamente,entrambe leguide sonotristemente obsolete,apartire da Wordpress 5,che hotrovatonelmodopiù duromentre rompevo le cose (anche quella di Smashing Managzine haevidentierrori di sintassi - qualcunonon è riuscito apadroneggiareil copiae incolla).Non hotrovato un'alternativa aggiornata ("custom-list-table-example" è solo leggermentemigliore)e il Codex hamolte cosemancanti.Sono riuscito a scrivere una sempliceimplementazioneguardando lo stesso Wordpress,specialmente `class-wp-users-list-table.php` che è quasi completomapiù semplice di altre classi WP.Unfortunately, both of the guides are woefully out of date, as of Wordpress 5, which I found the hard way while breaking things (Also the Smashing Managzine one has glaring syntax errors - someone failed to master copy&paste). I haven't found an up to date alternative (the `custom-list-table-example` is only slightly better) and the Codex has a lot of things missing. I managed to write a simple implementation by looking at Wordpress itself, especially `class-wp-users-list-table.php` which is almost fully featured but simpler than other WP classes.
- 1
- 2020-06-07
- Guss
-
@Guss La risposta è del 2012. Potresti aggiungere latua rispostaper offrire una soluzionepiù aggiornata :)@Guss The answer is from 2012. You might want to add your own answer to offer a more up to date solution :)
- 0
- 2020-06-08
- kaiser
-
@ Kaiser - l'hafatto.Vedi sotto :-)@Kaiser - did that. See below :-)
- 0
- 2020-06-09
- Guss
-
- 2011-12-24
Usa questoesempio (scritto come unplugin)per creare letuetabelle di amministrazione:
http://wordpress.org/extend/plugins/custom-list-table-example/
Utilizza la classe WP_List_Table incorporata.
Use this example (written as a plugin) to create your admin tables:
http://wordpress.org/extend/plugins/custom-list-table-example/
It uses the built-in WP_List_Table class.
-
Penso che questa dovrebbeessere la risposta accettata.Vedi anche questo articolo su Smashing Magazine che articola un approccio simile: http://wp.smashingmagazine.com/2011/11/03/native-admin-tables-wordpress/I think this should be the accepted answer. Also see this article in Smashing Magazine that articulates a similar approach: http://wp.smashingmagazine.com/2011/11/03/native-admin-tables-wordpress/
- 3
- 2012-03-10
- julien_c
-
- 2011-05-27
Inoltrepuoi utilizzare questopiccolopluginper visualizzare lepossibilità delbackendin WP: https://github.com/bueltge/WordPress-Admin-Style
Also you can use this small plugin for view the possibilities of the backend in WP: https://github.com/bueltge/WordPress-Admin-Style
-
- 2010-09-07
Potrestiprenderein considerazione l'aggiunta di unfiltro all'elenco deitipi dipostpersonalizzatinell'amministratore?La risposta collegata di seguitomostra comefarlo con unatassonomia,mapotrestifacilmente utilizzare altri criterineltuo hook
restrict_manage_posts
:Fammi sapere se hai altre domande.
You might want to consider adding a filter to your custom post type list in the admin? The linked answer below shows how to do it with a taxonomy but you could easily use other criteria in your
restrict_manage_posts
hook:Let me know if you have more questions.
-
Mi scusoper la domandapoco chiara.Nelmioprimoesempioera unatabella deipost,e ineffetti,potreiprovare a utilizzare latabella deipostesistenteper quello (anche se vogliomostrare soloi titoli deiposte quinditutte le colonnepersonalizzate?).Ma ora homodificato lamia domanda con unesempio concreto: ho unatabella dei domini,quindinonesiste unatabellaesistenteequivalente chepossoespandere.I apologize for the unclear question. In my first example it was a table of posts, and indeed, I could try to use the existing post table for that (even if I only want to show the post titles and then all custom columns?). But now I have edited my question with a concrete example: I have a table of domains, so there is no equivalent existing table that I can expand.
- 0
- 2010-09-07
- Jan Fabry
-
* @ Jan *: Ah.Sì,penso chetu abbiatrovato la verità,chenonesiste unbuonmodoincapsulatoperfarlo senon scrivere HTML (duplicato).Ho avuto spesso lo stessoproblema.Forse creare unticket su Trac chiedendo questomiglioramentoe collegare l'URL/ticket # quiin modo dapoterlo supportare.*@Jan*: Ah. Yes, I think you have found the truth, that there is not good encapsulated way to do this other than writing (duplicated) HTML. I've often had the same issue. Maybe create a ticket on trac asking for this enhancement and link the URL/ticket# here so we can support it.
- 0
- 2010-09-07
- MikeSchinkel
Qual èilmodo consigliatoper creare unapagina con unatabella,nello stile delletabelle chemostranoi post ogli utentinell'area di amministrazione?
Stoespandendo ilplug-in Cache Images e contiene unatabella coni dominie una serie diimmagini da quel dominio. Quindinonesiste unatabellaesistenteequivalente su cui costruire (nellaprima versione di questa domanda,ho chiestoinformazioni su unatabella conpost,ma lìpotrei (forse) espandi latabella deipostesistente ).
Dovreibasarmi solo su lapagina dellapanoramica delpost e inizia con un
<table class="widefat">
o ci sonofunzionimigliori chegestiscono questo ora? Conosci unesempiopulitoe vuoto di unatabella conpaging su cuipotreibasareilmio lavoro?