Create new Doctype for showing jobs of a portfolio on Website

Hello,

Long time without being over here!

So grateful of so stable ERPNext is becoming… very few problems, hence low activity over here.

I am revisiting the Website habilities on ERPNext, and they have improved a lot. I am beginning to think on leaving Wordpress at last, and being able to just stay on ERPNext for everything.

But one part very important of my website is a portfolio, to show samples of all the jobs and services we do.

My first question is if someone could advice me of using something already on ERPNext to help me doing this. If it is already in there, I don’t realize of how to do it.

Other thing I think is if me, being a no coder, would able to create myself some Doctype to do this.

To start evaluating this, I enabled developer mode on my install, and with Administrator account, I was able to create a Doctype “Portafolios Job”, and set it as with Web View.

The problem I have is that I can’t see on every Portafolio Job I create, anything to view this on the website. And even using the route, I can’t see what I created.

I can’t realize what I am doing wrong.

Many thanks in advance, and as always kind regards from Spain,

Hola @pagliaso!

Do you get any error message? Or just an empty webpage (just the title at the top)?

Hola @avc !

Many thanks for your reply.

Once I got empty webpage, with the title at the top, but the rest of the time I got an error:

Excepción de servidor no detectada Error 500

And the Traceback:

Traceback (most recent call last):
  File "apps/frappe/frappe/website/serve.py", line 18, in get_response
    response = renderer_instance.render()
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 52, in render
    html = self.get_html()
  File "apps/frappe/frappe/website/utils.py", line 517, in cache_html_decorator
    html = func(*args, **kwargs)
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 61, in get_html
    self.update_context()
  File "apps/frappe/frappe/website/page_renderers/document_page.py", line 69, in update_context
    self.context.update(self.context.doc.get_page_info())
AttributeError: 'Prueba' object has no attribute 'get_page_info'

I forgot to tell that I am in:

ERPNext: v14.41.2 (version-14)

Frappe Framework: v14.51.0 (version-14)

Many thanks and kind regards,

Hi @pagliaso:

For webview, your doctype needs 2 fields

route (automatically filled with id of each document)
published (boolean, indicates if a document is published or not

On your doctype options:

Where http://yoursite.com/portfoliojob will be the url route where your view will be accesible.

Addditionally, you will need to modify this files:

yourdoctype/templates/yourdoctype.html (view of each “page”)

and

yourdoctype/templates/yourdoctype_row.html (list view)

Example:

{% extends "templates/web.html" %}

{% block page_content %}
<h1>{{ title }}</h1>
{{ description }}
{{ execution_year }}
{% endblock %}

where data between double brackets represents doctype fields
More info here:
https://frappeframework.com/docs/user/en/tutorial/portal-pages

Ánimo :slight_smile:
Hope this helps.

Hi @avc,

Many thanks for your help!

I was misreading the documentation but thanks to your screenshot and your detailed instructions, I am nearly there. With your instructions I have been able to get a page with a list and the individual pages of each job.

I am still getting wierd issues with the routes. At first another page was appearing where the list should appear. But I think this maybe the chaos I have at the moment with all the tests.

Mil gracias!!!

Many thanks and kind regards,

Alb

1 Like