0
votes

Hey I am pretty new to typo3 and I want to build a website. I am running version 10.4.4 of TYPO3 with the bootstrap package installed. I have tried to follow the guide on https://docs.typo3.org/typo3cms/extensions/gridelements/stable/

I have copied the TypoScript into my template setup, but there is no output on the frontend. Remember I am new to this so I don't understand the TypoScript well yet.
So any ideas to what I could do?

EDIT: I want to use GriElements so that I can create my own layouts on my page. The standard layouts are good but I need more freedom than what they offer.

I can get output on the frontend without GridElements, but when I use the extension only the content in the GridElements block wont show. If I remove the standard TypoScript from the example on the manual page for this extension i get an error saying "Oops an error occurred! Code:" and then a code that changes every time I update the page.

My TypoScript on my template looks like this:

page.includeCSS.1 = fileadmin/user_upload/template/css/fonts.css
page.includeCSS.theme = fileadmin/user_upload/template/css/custom-theme.scss


# plugin.tx_bootstrappackage._LOCAL_LANG.da.readmore = test (NOT WORKING)
# https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Internationalization/ManagingTranslations.html

page.meta.robots = noindex, nofollow
page.meta.robots.replace = 1
page.10.partialRootPaths.3 = fileadmin/user_upload/template/partials/ContentElements/
page.10.partialRootPaths.4 = fileadmin/user_upload/template/Partials/Page/
page.10.dataProcessing.10.levels = 3
page.includeJSFooterlibs.bootstrap_navbar = fileadmin/user_upload/template/js
page.includeJSFooterlibs.bootstrap_navbar = fileadmin/user_upload/template/js/navbar.js
lib.contentElement.partialRootPaths.20 = fileadmin/user_upload/template/partials/ContentElements/
lib.contentElement.partialRootPaths.20 = fileadmin/user_upload/template/Partials/ContentElements/



lib.gridelements.defaultGridSetup {
  // stdWrap functions being applied to each element

  columns {
    default {
      renderObj = COA
      renderObj {
        # You can use registers to i.e. provide different image settings for each column
        # 10 = LOAD_REGISTER
        20 =< tt_content

        # And you can reset the register later on
        # 30 = RESTORE_REGISTER
      }
    }
  }

  # if you want to provide your own templating, just insert a cObject here
  # this will prevent the collected content from being rendered directly
  # i.e. cObject = TEMPLATE or cObject = FLUIDTEMPLATE will be available from the core
  # the content will be available via fieldnames like
  # tx_gridelements_view_columns (an array containing each column)
  # or tx_gridelements_view_children (an array containing each child)
  # tx_gridelements_view_column_123 (123 is the number of the column)
  # or tx_gridelements_view_child_123 (123 is the UID of the child)

}

lib.tt_content.shortcut.pages = COA
lib.tt_content.shortcut.pages {
  10 = USER
  10 {
    userFunc = tx_gridelements_view->user_getTreeList
  }
  20 = CONTENT
  20 {
    table = tt_content
    select {
      pidInList.data = register:pidInList
      where = colPos >= 0
      orderBy = colPos,sorting
      orderBy.dataWrap = FIND_IN_SET(pid,'{register:pidInList}'),|
    }
  }
}

tt_content.shortcut.5 = LOAD_REGISTER
tt_content.shortcut.5 {
  tt_content_shortcut_recursive.field = recursive
}

tt_content.shortcut.20 {
  0 {
    tables := addToList(pages)
    conf.pages < lib.tt_content.shortcut.pages
  }
  1 {
    tables := addToList(pages)
    conf.pages < lib.tt_content.shortcut.pages
  }
}

tt_content.gridelements_pi1 >
tt_content.gridelements_pi1 = COA
tt_content.gridelements_pi1 {
  #10 =< lib.stdheader
  20 = COA
  20 {
    10 = USER
    10 {
      userFunc = tx_gridelements_view->main
      setup {
        default < lib.gridelements.defaultGridSetup
      }
    }
  }
}

The statics i included is:

Bootstrap Package: Full Pacakage (bootstrap_package)
Bootstrap Package: Bootstrap 4.x (SCSS) (bootstrap_package)
XML Sitemap (seo)
Gridelements w/DataProssing (recommended) (gridelements)
Gallery (bm_image_gallery)

EDIT2: New TypoScript with DataProcessing

lib.gridelements.defaultGridSetup =< lib.contentElement
lib.gridelements.defaultGridSetup {
  templateName.field = tx_gridelements_backend_layout
  templateName.ifEmpty = GridElement
  layoutRootPaths {
    1 = EXT:gridelements/Resources/Private/Layouts/
  }
  partialRootPaths {
    1 = EXT:gridelements/Resources/Private/Partials/
  }
  templateRootPaths {
    1 = EXT:gridelements/Resources/Private/Templates/
  }
  dataProcessing {
    10 = GridElementsTeam\Gridelements\DataProcessing\GridChildrenProcessor
    10 {
      default {
        as = children
        # Default options of the grid children processor
        # Change them according to the needs of your layout
        # Read more about it in the TypoScript section of the manual
        # options {
          # sortingDirection = ASC
          # sortingField = sorting
          # recursive = 0
          # resolveFlexFormData = 1
          # resolveBackendLayout = 1
          # respectColumns = 1
          # respectRows = 1
        # }
      }
    }
  }
}

My includes:

Fluid Contetn Elements (fluid_styled_content)
Fluid Contetn Elements CSS (fluid_styled_content)
Bootstrap Package: Full Pacakage (bootstrap_package)
Bootstrap Package: Bootstrap 4.x (SCSS) (bootstrap_package)
XML Sitemap (seo)
Gridelements w/DataProssing (recommended) (gridelements)
Gallery (bm_image_gallery)

The error I get:

Tried resolving a template file for controller action "Standard->3" in format ".html", but none of the paths contained the expected template file (Standard/3.html). The following paths were checked: /httpdocs/typo3conf/ext/bootstrap_package/Resources/Private/Templates/ContentElements/, /httpdocs/typo3conf/ext/gridelements/Resources/Private/Templates/
4
You added the static template Gridelements w/DataProssing but your TypoScript is the code of the other static template of gridelements. So actually you use both static templates - not sure if you made changes to the copied code. The kind of implementation differs for both, so you have to make a decision which one to use.David
As explanation: Gridelements w/DataProssing is rendering the content with fluid-templates while the other (and older) template is building it exclusively in TypoScript. The age can be seen in the code above already because lib.stdheader was removed from TYPO3. Nevertheless using that template without lib.stdheader is possible.David
From lib.gridelements.defaultGridSetup is copied directly from the manual and lib.stdheader is commented out also in the manual.wizzi
As I said in my answer: You forgot to include the static template of fluid_styled_content before gridelementsMarco M
You're just using two different templates, no matter if from the manual or directly from the TypoScript-files of the extension. The manual might be outdated and never include the description of the newer TypoScript-template. Basically you've to understand that you've to decide for one definition / kind of usage.David

4 Answers

1
votes

You probably missed to include the static template of gridelemnts. To do so edit your TS-Root-Template, select in the dropdown at the top "Info/Modify", hit the button "Edit the whole template record", go to tab "Includes" and select gridelements static setup in the Multiselect box on the right.

1
votes

Please provide more information:

  • Which static templates have you included at all? Maybe you forgot to include fluid_styled_content?
  • How does your Typoscript/Flexform setup look like?
  • For what do you need gridelements?

EDIT: bootstrap_package did not very well together with gridelements in the past. Maybe you should first try to install Benjamin Knott's extension autogrids (see this issue on github for more information)

EDIT 2: Try this Typoscript, it just wraps a section around all elements but maybe you will then see your content in the frontend:

tt_content.gridelements_pi1.20.10.setup {
    section < lib.gridelements.defaultGridSetup
    section {
        wrap >
        dataWrap = <section id="c{field:uid}">|</section>
    }
}
0
votes

SOLVED: I installed an extension that is called "Grids for bootstrap" included it in the template and it worked.

Thnaks for all the help you guys gave!

0
votes

I think your problem is coming from your fluid code for gridelemnts, you didn't use the right syntax maybe.