#Need guidance on how to go about researching things + doubts

1 messages ยท Page 1 of 1 (latest)

shut cloud
#

So, newbie here, trying desperately to run from Drupal to anything else that embraces code and versioning. Trying to experiment with payload, I came into some unresolved points and I'm not really sure on where to find the answers.

The first one is more "I couldn't find it in the docs" related. I went the blank template way, only focusing on the backend and admin stuff for now. I created a custom collection, and because of the "tree nature" of this collections (instances can have a parent that is also an instance in this collection), I wanted to create a custom view for this specific collection. The docs showed me that I could provide a custom view for this purpose in the collection config (admin.components.views.List), but I had a really hard time on how to implement this view, specially because the docs mix the collection custom view with the admin custom view part, and they are completely different types... I had to find someone talking about a bug in their implementation of a custom view, and they also said they had to go through the cms code, find the default implementation there to see what was expected as props and how to use the stuff. And that was what i did to be able to start to implement a custom collection view of my own... What am I doing wrong?

The second one was on installation: found somewhere (not on the docs) that you can go for a traditional installation (payload cms backand in one place, some frontend in another place) and also setup in a way that both the backend and frontend reside in the same project and codebase. The website and ecommerce templates are built this way, but the blank one only includes the backend and there's nowhere to find a how-to setup a blank installation that includes the next frontend (also blank) there... Is there a way that doesnt involve installing the website or ecommerce templates and wiping out everything that comes with it to get to a "blank state"?

mortal heathBOT
shut cloud
#

And a bonus third: I saw on reddit and on youtube that payload was going through a deep rearchitecting to adopt nextjs as a default tech. Has this reachitect been finalized? Where to find info about this? Someone said that the "both backend and frontend" on same codebase didn't work for Nextjs 14 unless using a adapter... Does anyone here knows where to find this adapter?

gusty nexus
# shut cloud And a bonus third: I saw on reddit and on youtube that payload was going through...

This is the 3.0 :) Payload team is working on it rn and it's in alpha phase right now. Paul said in general that 3.0 is aimed to be stable in about a month (wow).

There was this nextjs solution that could be used before, which is very hacky to get it going and working.

If you want to have backend and frontned (if you are using nextjs for it) in the same folder, with payload local api, wait for 3.0, it will be waaaaay easier that way.

#

If you want some other frontend framework, I can't help you here, don't know much about multitenant apps when working with payload.

But, if you are learning payload, you can start with frontend and backend separated. Migration from 2.0 to 3.0 should be really easy, and as of alpha, it really was about like 10 minutes of work once you get alpha installed.

shut cloud
#

@gusty nexus thanks man ๐Ÿ™‚ anywhere i can track this stuff by myself? And what about my first point on how lost I became while looking for documentation, any comments or I am doing as expected?

gusty nexus
#

Also, I don't know how developement in drupal goes, but recently I migrated a website from drupal to payload. It was funny how I had to teach the developers to "think TypeScript" and that the drupal way is different

shut cloud
#

Yeah, what i wanted to do was display the instances of a collection as a tree structure instead of a table...

gusty nexus
#

Thinking about it, you could try virtual fields. Setup a relations and then automatic filling of those virtual fields. Just make sure that you are not referencing all of the relations when nesting like this, had a problem there where I was getting 40MB api calls

shut cloud
#

Even though that is displayed in the admin area, this requires a custom collection view, right? (I have a total of 5 hours of experience with Payload CMS)

#

No idea what virtual fields are... But I don't see a way to remove the table visualization...

#

Well, you did exactly what i am doing now: getting away from Drupal

#

I'm on the task of migrating an existing Drupal 7 site to Drupal 10... But as we are suffering through every step, I was wondering if it would be nice to go headless (and modern and versionable)

#

Then I started to try payload and the 1st thing I focused were taxonomies

#

How did you manage taxonomies in your migration?

gusty nexus
#

The website I was migrating was also on Drupal 7, but (thank god) I didn't have to do anything with it. Everything I needed was content (around 400 pages). Just prepared Payload and created scraper and with a little touch of AI, that scraper populated Payload with all the content needed. Then I just copied users and permissions 1 - 1.

shut cloud
#

OMG, i envy you, haha

gusty nexus
#

BTW I just read what you need again. What props do you need in your view?

shut cloud
#

My case won't be that straight... My Drupal site is a government one, the architecture sucks (as with all Drupal stuff) and there are maaany things that depend on these taxonomy things...

gusty nexus
#

oooooh

#

That sucks. And it's not only drupal that sucks there tbh :D Had a chance to look at once goverment project, refused it cause of the decisions that they made there.

#

Buuut

#

Back to the custom view

#

Here's what I am using at mine:

shut cloud
#

The thing is, the docs tell you what to implement when trying to create a Admin View, and that is an AdminViewComponent that receives {user, canAccessAdmin} as props...

#

But there are no examples on how to do a custom View for a specific collection

gusty nexus
#

Hmmm can you try this?

In your collection "config", add the admin key:

shut cloud
#

yeah, that's whay i went for

gusty nexus
shut cloud
#

yes yes, i just found odd that they don't tell anywhere what will the props be for the component that you use in List or in Edit

#

and i couldn't find any official examples as well

#

So I had to go through their source code to find how they implement the default one

gusty nexus
#

I think they do, don't they? Right below it is link to building a custom view component

shut cloud
#

That's the thing, the link goes to the admin views

#

not the collection views

#

and that took me a long time to figure

gusty nexus
#

oooh, right.

shut cloud
#

5 hours with payloadcms, 3 were on this T_T

gusty nexus
#

Well, now I am on thin ice, but I think that the views are exactly the same in their funcionality.

shut cloud
#

First thing I tried was copying one of those examples to my code. Didn't work

#

thery are different

#

the admin ones don't reveive docs / collection items in their props

#

the collection ones do

gilded cypress
#

@shut cloud hey , is ur issue that u can't receive data into ur react components ?

shut cloud
#

@gilded cypress nah man, i think i found a little problem with the docs actually...

#

The docs talk about custom admin views and custom collection views... but both of them have links that take you to custom admin views

#

so, there are no custom collection views to be found

gilded cypress
shut cloud
gilded cypress
#

aaaah u mean list

#

the table ?

shut cloud
#

No no, the admin views recieve no collection data... I hava a collection with inherent tree structure... And I wanted that collection to have a custom display... The docs mention you can have collection specific views, but fail to give an example on how to do it (and as a consequence, you get no documentation on the expected props)

gilded cypress
#

just to make sure i understand u
u need to create custom admin view ( not custom component but the hole admin view )
and you want to recieve the collection data so u play with it and display it right ?

shut cloud
#

You guys know where I can send the devs a message to warn about this? Mr @gusty nexus told me they are working on the 3.0 stuff, but this is an easy to miss thing and I bet it will remain this way after ๐Ÿ™‚

#

@gilded cypress , when you click on any collection on the admin view, it shows a table, a pretable containing some filters and a header... For one specific collection, I would like to change this: no pretable, and use a tree view instead of a table

gusty nexus
#

I think someone was already talking about docs today actually :D The response to it was that they are working on improving it. Also on the community call, I think jmikrut was talking about updating the docs once 3.0 comes out.

shut cloud
#

I think I solved my problem, I am at working right now (Drupal hell) but will get back to Payload once back home... I just found it so hard to find the answers I needed... But if it's just a documentation problem, that's better than an architecture/design flaw on their solution, I guess ๐Ÿ™‚

gilded cypress
shut cloud
#

Anyway, thank you guys... Gonna end the work day for now, gotta take the bus ๐Ÿ™‚

gusty nexus
#

I will just leave this here, if you need it: